On Mon, 23 Jun 2014 13:10:40 +0200
Toni Schornböck wrote:

> Hi.
> 
> Yes "WHITELIST" all Emails. I don't want to WHITELIST emails. I want
> to score those emails.
> 
> My question is the following:
> I want to apply a spamassassin rule based on the IP address of the
> server that delivered this email to my mailserver.
> Is this possible?


If you want to use a customized score rather that use one of the
whitelisting rules you can do something like:


header  GOOD_IP  X-Spam-Relays-External =~ /^[^\]]+ip=1\.1\.2\.3\.4 /
tflags  GOOD_IP  nice
score   GOOD_IP  -2.0


Note that this only looks at the ip address recorded by your mx
server so can't be faked. You can alternately use the reverse-dns if
it's recorded in your received header:


header  GOOD_SERVER X-Spam-Relays-External=~ /^[^\]]+rdns=[^ ]*something\.com /

X-Spam-Relays-External is an extra pseudo-header so doesn't need to be
present in the email .


Reply via email to