1
---------
The following symbolic constants can be used in $final_spam_destiny:
D_DISCARD: Mail will not be delivered to its recipients, sender will NOT be notified. Effectively we lose mail (but will be quarantined unless disabled). Losing mail is not decent for a mailer, but might be desired.
D_BOUNCE: Mail will not be delivered to its recipients, a non-delivery notification (bounce) will be sent to the sender by amavisd-new; Exception: bounce (DSN) will not be sent if a virus name matches $viruses_that_fake_sender_re, or to messages from mailing lists, or for spam level that exceeds the $sa_dsn_cutoff_level.
D_REJECT: mail will not be delivered to its recipients, sender should preferably get a reject, e.g. SMTP permanent reject response.
Disable notification mails for quarantined mails
Does it work if you add two more options inside all '$policy_bank' blocks?
warnbannedrecip = 0, # 1 enable warnbannedsender =0, # 1 enable
notification mails for quarantined mails
To avoid sender or recipient warning notifications, you must set
$final_banned_destiny = D_DISCARD; #discard mail without notifying anyone
instead of
$final_banned_destiny = D_REJECT; #reply to sender and recipient with a warning notification
iiii
Hard sender whitelists and blacklists
amavisd can maintain whitelists and blacklists of message senders. It uses a message's envelope address (the one provided in the SMTP MAIL FROM command) as the sender address. Whitelisting ensures that amavisd will allow mail from a whitelisted sender to continue to its intended recipients; blacklisting ensures that amavisd will treat mail from a blacklisted sender as spam.
As with other amavisd address-matching features, you can specify addresses to globally whitelist:
by an array
Set the @whitelist_sender_maps array to a list of sender addresses to whitelist.
@whitelist_sender_maps = (['.example.org', '.example.net']);
@whitelist_sender_maps = ([qw(.example.org .example.net)]); # same thing
@whitelist_sender_maps = ( [".$mydomain"] ); # $mydomain and its subdomains
by keys of a hash
Create a hash lookup table constructed in-line, with keys lowercased
map { $whitelist_sender{lc($_)}=1 } (qw(
cert-advisory-owner@cert.org
owner-alert@iss.net
slashdot@slashdot.org
bugtraq@securityfocus.com
));
by a set of regular expressions
Finally, you can specify senders to whitelist by providing a list of regular expressions that match the sender addresses to the new_RE function and assigning the result to $whitelist_sender_re. You may use domain names instead of sender addresses to whitelist all mail sent from a given domain.
@whitelist_sender_maps = ( new_RE(
qr'.*@akadia.com$'i,
qr'.*@swisscom\.com$'i,
qr'.*@sicap\.com$'i,
qr'.*@glue\.ch$'i,
qr'.*@\.*\.admin\.ch$'i
));
You can use a similar set of variables for globally blacklisting senders. The array is @blacklist_sender_maps.
The default amavisd.conf defines $blacklist_sender_maps as shown below. Many username patterns typical of spammers are blacklisted, such as investments; many addresses of well-known security and vendor mailing lists are whitelisted.
Default blacklist entries in amavisd.conf
$blacklist_sender_re = new_RE(
qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou|greatcasino)@'i,
qr'^(investments|lose_weight_today|market.alert|money2you|MyGreenCard)@'i,
qr'^(new\.tld\.registry|opt-out|opt-in|optin|saveonlsmoking2002k)@'i,
qr'^(specialoffer|specialoffers|stockalert|stopsnoring|wantsome)@'i,
qr'^(workathome|yesitsfree|your_friend|greatoffers)@'i,
qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i,
);
Soft sender whitelists and blacklists
Instead of hard black- or whitelisting, a softer approach is to add score points (penalties) to the SpamAssassin score for mail from certain senders. Positive points lean towards blacklisting, negative towards whitelisting. This is much like adding SpamAssassin rules or using its white/blacklisting, except that here only envelope sender addresses are considered (not addresses in a mail header), and that score points can be assigned per-recipient (or globally), and the assigned penalties are customarily much lower than the default SpamAssassin white/blacklisting score.
@score_sender_maps = ({
'.' => [ # the '.' matches any recipient
new_RE (
[qr'.*@akadia.com$'i => -10.0],
[qr'.*@swisscom\.com$'i => -10.0],
[qr'.*@sicap\.com$'i => -10.0],
[qr'.*@glue\.ch$'i => -10.0],
[qr'.*@\.*\.admin\.ch$'i => -10.0]
)
]
});
-----------