Re: [Exim] Controlling Spamassassin Scanning by Subnet in Ex…

Top Page
Delete this message
Reply to this message
Author: Nico Erfurth
Date:  
To: Owen Creger
CC: spamassassin-talk, 'exim-users@exim.org'
Subject: Re: [Exim] Controlling Spamassassin Scanning by Subnet in Exim
Owen Creger wrote:
> I have seen this going around several times without a resolution, on
> spamassassin and exim mailing lists
>
> By using a regular expression (regex) in a condition statement, I was able
> to control the spamassassin router and director by IP address.
> I'm running Exim 3.2X, however this technique would most likely work with
> 4.X also.
> I'm using Exim solely as a relay into and out of my network.
> I have several hosts that use the relay, and I don't want their outbound
> messages to be scanned.
>
> To stop messages from being scanned that have already been scanned,
> originate locally, or the 10.1.2.0/24 network:
>
> condition = "${if and { {!def:h_X-Spam-Flag:} \
>                   {!eq {$received_protocol}{spam-scanned}} \
>                   {!eq {$received_protocol}{local}} \
>                   {!match {$sender_host_address}{^10\.1\.2\.}} } {1}{0}}"


maybe it's better to this, instead of the last {match}

{!eq {${mask:${sender_host_address}/24}} {10.1.2.0/24}}

This is much more readable, and maintainable, if you have a bigger
network, that's not class-based :)

ciao