[Mimedefang] MIMEDefang - Restricting To Certain Email Addressees...?

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Tue Jun 20 02:36:07 EDT 2006


On Mon, 19 Jun 2006, nathan r. hruby wrote:

>> BUT...  The problem is that I really don't want to filter out enclosures 
>> for
>> all of the email accounts on my system, just the ones associated with the

Well, then do it just for these addresses :-)

somewhere in sub filter you'll have action_replace_with_url(), just 
conditionally call this function, e.g. (stripped down heavily):

my $aRcptIsList;
sub filter_begin  {
$aRcptIsList = undef;
for (@Recipients) {
 	# Sendmail takes care of malformed mail addresses
 	if(/\@(?:domain1|domain2|domain3)>?$/i) {	# it's my domain
 		if(/^<?(?:list1|list2)\@/i) { # it's one of my lists
 			$aRcptIsList = 1;
 		}
 	}
}

}

sub filter {
 	if($aRcptIsList) {
 		action_replace_with_utl( arguments )
 	}
}


> sub filter_recipient {
>    my($recip, $sender, $ip, $host, $first, $helo, $rcpt_mailer, $rcpt_host, 
> $rcpt_addr) = @_;
>    my %lists = ( 'list1 at address.com' => 1,
> 		  'list2 at somethingelse.com' => 1);
>
>    if ($lists{$recip}) {
>      return ('CONTINUE', "ok");
>    } else {
>      return('ACCEPT_AND_NO_MORE_FILTERING', "$recip is not a mailing list");
>    }
> }

This will work, too, because the complete sub filter will be 
condistionally called only, when one of the recipients is a list, but why 
would you ignore MIMEDefang's strength to scan all mails for virues and 
SPAM. :-)

Bye,

-- 
Steffen Kaiser



More information about the MIMEDefang mailing list