I'd like to know how to configure amavisd-new to only scan for Spam on particular clients (IPs, CIDRs or hostnames) or alternatively sender's email domain.
I know that it is possible to do it on a recipient's mail address but not on how to do it for the sender's mail address. It is even possible to do it on a recipient's IP address with policy banks. But my approach should be to be independent of recipient and only relay on the sender.
What I want to accomplish is to only scan mails originating from Yahoo, Google, Hotmail and the other big senders. So it is easier to configure which senders should be observed than the ones that shouldn't.
I known that it is easier to achieve on the MTA side, but that is not part of the question because I already go a solution on the MTA side. I want to do it on amavisd-new. And it doesn't help to know how to put senders on a whitelist, as this still means that the mail goes through all the scanning but then gets a high negative score. The mail shouldn't be scanned at all unless sent by the big players.
So which parameters in amavisd-new is the right one to enable scanning for particular senders and only for these?
Amavisd whitelist all except certain domain
What you need is whitelist_sender_map (here) with regex lookaround (here)
Whitelist all except Domain.X
Whitelist all except Domain And Sub-Domain of X
Modifying
For example, adding msn.com to whitelist exception
DON'T BREAK THAT RULE INTO MULTIPLE RULES, IT IS NOT WHAT YOU WANT
Breaking the rules in 2 or more lines will WHITELIST EVERYTHING!!
(I will put this section in red if possible)
In simple terms, whitelist is a sequencial check, one line/rule at a time.
Let look at the following WRONG example
You end up whitelisting all senders!!
Perl Testing Program