Re: [Exim] routing only non-local mail to spamassassin

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: Test, James
CC: exim-users
Temat: Re: [Exim] routing only non-local mail to spamassassin
On Wed, 10 Sep 2003, Test, James wrote:

> I currently have the following router statement (using exim 4.22):
>
> spamcheck_router:
>   driver = accept
>   transport = spamcheck
>   local_parts = lsearch;/etc/mail/spamusers
>   no_verify
>   condition = "${if and { {!def:h_X-Spam-Flag:} \
>                           {!eq {$received_protocol}{spam-scanned}} \
>                           {!match {$sender_host_address}{/^129\.246\./}} } {1}{0}}"

>
> I'm trying to only check for spam if the email is not coming from our
> network (129.246.0.0/16). I think $sender_host_address is always
> blank for some reason. Anyone have any ideas how I can do this?


$sender_host_address will be unset for messages that do not originate
from a remote host. Since you are checking for a protocol of
"spam-scanned", I assume this message has been re-injected from a spam
scanner running on the local host. Hence, the message has not come from
a remote host.

What you could do is to pass $sender_host_address to your spam scanner,
and have it pass it back using -oMa.


--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book