[Mimedefang] RFC822 From: header

David F. Skoll dfs at roaringpenguin.com
Fri Jun 10 14:12:46 EDT 2005


Steve Jordan wrote:

> We want to use the RFC822 From: header to reject mail purporting to be
> from info at uic.edu and some other addresses. I can not find where this
> information is available to me in mimedefang-filter. The RFC822 Subject:
> line is available as the global variable $Subject. I spent a couple of
> hours and found a solution by setting up a global variable called $From by
> making minor modifications to mimedefang.c and mimedefang.pl.in. If I have
> not re-invented the wheel, I would like these modifications to be included
> in the next release of MIMEDefang.

I think you did reinvent the wheel. :-)

You can easily get any header you like by opening the ./HEADERS file from
Perl:

if (open(HDRS, "<./HEADERS")) {
   while(<HDRS>) {
      chomp;
      $From = $1 if (/^From:\s*(.*)/i);
   }
   close(HDRS);
}

Note that the $From variable might contain all kinds of wacky stuff,
because its syntax is not verified by Sendmail (as the envelope MAIL FROM
argument is.)

Regards,

David.



More information about the MIMEDefang mailing list