[Mimedefang] To stop spam checking of Internal mail

Tony Nugent tony at linuxworks.com.au
Wed Jul 16 00:56:01 EDT 2003


On Tue Jul 15 2003 at 22:32, "Kevin A. McGrail" wrote:

> Hmm, I don't really know the flow with this function will work for
> mimedefang but perhaps something like this will help get the brain thinking.
> My one worry is that you don't want to filter by IP but hey, it's just a
> thought:
> 
> sub filter_relay {
>     my($hostip, $hostname, $helo) = @_;
> 
>     if ($hostip eq '127.0.0.1' or $hostip =~ /^10\.10\.10\./) {
>       #if the host IP matches local or a local subnet than mark spamassassin
> as not available
>       $Features{"SpamAssassin"} = 0;
>     }
> 
>     return ('CONTINUE', 'ok');
> }
> 
> KAM

I use a similar logic early in the filtering to set a global
variable if the message comes from an internal source (for relay).
I then use this variable (especially in filter_end()) to include or
exclude the message for specific filtering, and it works nicely to
avoid spamassassin checking for trusted local relay email.
(Although everything accepted does get checked for virus and other
bad attachments).  I also use a similar methodology for "protecting"
some local email aliases used in-house as small restricted mailing
lists (only specific people/computers can use successfully post to
them).  I just love mimedefang... it's perl, and so customisable :-)

Cheers
Tony



More information about the MIMEDefang mailing list