Managing whitelist, blacklist and spam score in Zimbra Mail Server

Setup blacklist and whitelist for SPAM filter:
Easy method
As root, edit the amavisd config at /opt/zimbra/conf/amavisd.conf.in, add 2 lines:
#vi  /opt/zimbra/conf/amavisd.conf.in
read_hash(%whitelist_sender, ‘/opt/zimbra/conf/whitelist’);
read_hash(%blacklist_sender, ‘/opt/zimbra/conf/blacklist’);
Create the list files:
cat <<EOT > /opt/zimbra/conf/whitelist
sathish.com
EOT
cat <<EOT > /opt/zimbra/conf/blacklist
spammer@example.com
EOT
Then take effect by:
su – zimbra -c ‘zmamavisdctl restart’
Alternate method
Edit the amavisd config at /opt/zimbra/conf/amavisd.conf.in, at section:
$vi /opt/zimbra/conf/amavisd.conf.in
# ENVELOPE SENDER SOFT-WHITELISTING / SOFT-BLACKLISTING
@score_sender_maps = ({ # a by-recipient hash lookup table,
# results from all matching recipient tables are summed
# ## per-recipient personal tables (NOTE: positive: black, negative: white)
# ‘user1@example.com’ => [{‘bla-mobile.press@example.com’ => 10.0}],
# ‘user3@example.com’ => [{‘.ebay.com’ => -3.0}],
# ‘user4@example.com’ => [{‘cleargreen@cleargreen.com’ => -7.0,
# ‘.cleargreen.com’ => -5.0}],
## site-wide opinions about senders (the ‘.’ matches any recipient)
‘.’ => [ # the _first_ matching sender determines the score boost
new_RE( # regexp-type lookup table, just happens to be all soft-blacklist
[qr’^(bulkmail|offers|cheapbenefits|earnmoney|foryou)@’i => 5.0],
[qr’^(greatcasino|investments|lose_weight_today|market.alert)@’i=> 5.0],
[qr’^(money2you|MyGreenCard|new.tld.registry|opt-out|opt-in)@’i=> 5.0],
[qr’^(optin|saveonlsmoking2002k|specialoffer|specialoffers)@’i => 5.0],
[qr’^(stockalert|stopsnoring|wantsome|workathome|yesitsfree)@’i => 5.0],
[qr’^(your_friend|greatoffers)@’i => 5.0],
[qr’^(inkjetplanet|marketopt|MakeMoney)d*@’i => 5.0],
),
# read_hash(“/var/amavis/sender_scores_sitewide”),
{ # a hash-type lookup table (associative array)
###
### Add custom black / white list here :
###
# blacklisting:
‘promote@somedomain.com’ => 10.0,
‘spammer.com’ => 10.0,
# whitelisting:
‘sathish.com’ => -100.0,
And run restart aamvisd to take effect:
$zmamavisdctl stop && zmamavisdctl start
Redefine  your   spam score  according to your environment:
That required score is defined by a setting in your admin UI.
Go to Global Settings, the AS/AV tab, and you’ll see kill and tag percentages.
The “Required” score is 20 times the percentage in that tag field.
So for example, 20 * 35% (0.35) = 7. Change that to a lower number and you’ll have a lower required score–I have mine set at 24% which results in a required score of 4.8.

Leave a Comment

Your email address will not be published. Required fields are marked *

To Resolve this issue at just 5$ from ServerExpert

https://serverexpert.io/

For Hosting please visit Hostingwebsite.io

You have Successfully Subscribed!

Open chat