[Mimedefang] Ignoring Certain Domains

listuser at numbnuts.net listuser at numbnuts.net
Wed May 21 00:49:01 EDT 2003


On Tue, 20 May 2003, Michael Sims wrote:

> Quoting James McKiernan <James.McKiernan at robertwalters.com.au>:
> 
> > We now require to route mail leaving the company through this mail proxy. We
> > do however not want this mail to be scanned by spamassassin.
> > 
> > Does anyone on the list know how to configure  spamassassin or mimedefang to
> > ignore mail based on source IP or source domain or for that matter
> > destination domain or email address.
> 
> Jim McCullars posted a message explaining how to do this in filter_relay(), but 
> that method tells MIMEDefang to accept the message and stop any further 
> processing.  I have a different approach, because I personally need my outgoing 
> mail to still be scanned for viruses, I just do not want SpamAssassin to scan 
> it.
> 
> I took an idea that James Ralston posted to the list last month regarding 
> filtering (or not filtering) based on subnet/netmask pairs and expanded it a 
> little bit to create a sub called relayIsTrusted():

<SNIP>

> My actual filter is more complicated than that, but that should illustrate how 
> it works.  HTH...

That's a good idea.  I use a method that David or someone on the list 
introduced me to a while back.

    if ($Features{"SpamAssassin"}) {
      if ($RelayAddr ne "aaa.bbb.ccc.ddd" and
        $RelayAddr eq "127.0.0.1" or
        $RelayAddr =~ /^AAA\.bbb\.ccc\./ or
        $RelayAddr =~ /^aaa\.BBB\.ccc\./ or
        $RelayAddr =~ /^aaa\.bbb\.CCC\./   
      ) {
        
        # Disabled extension checks by returning immediately.
        return 0;
      } else {

I call it at the beginning of $Features{"SpamAssassin"}.  If it matches 
one of the netblocks our customers or our MTAs are in, it return 0 to 
Sendmail and goes on with life.  This way you can conditionally procede 
with the SA checks but not interfere with the rest of the checks.  Your 
method is less intrusive and easier to use in other subs.

I don't remember who showed me that so I can't give proper credit.  You
know who you are though. :)

Justin




More information about the MIMEDefang mailing list