[Mimedefang] How to Get Header info from $entity Object Passed to filter_end Routine

Joseph Brennan brennan at columbia.edu
Thu May 1 08:46:01 EDT 2003


> However, there's a pretty simple solution:  All of the headers
> are in the file ./HEADERS and are one-per-line (no line folding over
> multiple lines.)  The original raw message is in ./INPUTMSG

I do this:

   if (open(IN,"<./HEADERS")) {
        $head = MIME::Head->read(\*IN);
        $from = $head->get('from');
        $to   = $head->get('to');
        $cc   = $head->get('cc');
        $rec  = $head->get('received',0);  #most recent one
        close(IN);
        #various tests like for example
        if ($from) {
            chomp($from);
            if ($from =~ /postmaster\@columbia\.edu/) {
                md_log("Claims to be from postmaster");
                action_bounce('You are not postmaster at columbia.edu');
                return action_discard;
            }	
	}
   }


(We never send mail with postmaster in the From: line, but some
virus mail and other bogus mail has it.)

Joseph Brennan          Columbia University in the City of New York
postmaster at columbia.edu                 Academic Technologies Group







More information about the MIMEDefang mailing list