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

Top Page
Delete this message
Reply to this message
Author: Robert Kehl
Date:  
To: exim-users
Subject: Re: [Exim] routing only non-local mail to spamassassin
Am Mit, 2003-09-10 um 21.50 schrieb Test, James:

> 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?


This one should do it:

spamcheck_router:
  driver = accept
  hosts = !129.246.0.0/16
  transport = spamcheck
  local_parts = lsearch;/etc/mail/spamusers
  no_verify
  condition = "${if and { {!def:h_X-Spam-Flag:}\
                          {!eq {$received_protocol}{spam-scanned}}\
                        }{1}{0}}"


Or, even better, define a hostlist:

hostlist my_lan =129.246.0.0/16

and use this 'hosts =' entry:

hosts = !+my_lan

An ending :* is implied in the 'hosts =' rule, because the entry is
negated through the use of the ! symbol.

hth,

Robert Kehl