[Mimedefang] filter variable question

Jan Pieter Cornet johnpc at xs4all.nl
Tue Oct 12 09:41:57 EDT 2004


On Tue, Oct 12, 2004 at 08:00:19AM -0500, Keith Patton wrote:
> Hello all,
> 
> I am getting junk in and it is distinguished by some bogus as the 
> display name followed by a correct email address..
> 
> Does mimedefang-filter have the display name available in a variable, 
> for filter_recipient?
> 
> ie  ( bogus name < actual at actual.com >

Nope, as that is not part of the SMTP conversation. In filter_recipient,
you _only_ know the actual at actual.com. The rest of the information (like
"display name") is in the header, and you don't receive the header until
later, in the DATA phase. Maybe you want to check rfc 2821 or a primer on
SMTP in general, google should be able to find one.

You can have that information by parsing the To: header line in
filter_begin, something like this:

    use Mail::Address;
    open(H, "HEADERS");
    while ( <H> ) {
	if ( /^To:\s*(.*)/i ) {
	    @x = Mail::Address->parse($1);
	    last;
	}
    }
    close H;
    print "name of first recipient: ", $x[0]->name(), "\n";

(untested!).

-- 
#!perl -wpl # mmfppfmpmmpp mmpffm <pmmppfmfpppppfmmmf at fpffmm4mmmpmfpmf.ppppmf>
$p=3-2*/[^\W\dmpf_]/i;s.[a-z]{$p}.vec($f=join('',$p-1?chr(sub{$_[0]*9+$_[1]*3+
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):qw(m p f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig;                                # Jan-Pieter Cornet



More information about the MIMEDefang mailing list