[Mimedefang] $Sender Formatting for Global Variable Clarification

Damrose, Mark mdamrose at elgin.edu
Tue Jan 9 18:09:45 EST 2007


> -----Original Message-----
> From: Kevin A. McGrail
 
 
> Can anyone confirm if this is expected so that something like 
> this in filter_end would be guaranteed to work?
> 
> if ($Sender =~ /^<?someone at somewhere.com>?$/) {
>       $spamtest_enabled--;
>     }

I played with this a few months ago, so I'm going to answer this
from memory.  The short answer is no, it's not guaranteed.  The
$Sender variable will be populated with the exact string
presented by the client at MAIL FROM:

Before reading any further, I also concluded after playing with
this for a while that this is unlikely to be seen in the wild,
and your test above is good enough for most situations.



Unfortunately sendmail accepts addresses here in formats that
are (were?) legal on the To/CC Header for mail format, but are
not legal as a delivery address.

This includes both comments - i.e text enclosed in parenthesis, 
unless it is within quotes - and whitespace between tokens.

So something like
(comment) < user @ example . com >
would be accepted by sendmail and passed to MD in $Sender, and
then rewritten as
<user at example.com> 
when relayed to the next hop.





More information about the MIMEDefang mailing list