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 = ( '[EMAIL PROTECTED]' => 1,
                  '[EMAIL PROTECTED]' => 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
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to