Customized spam score for RBL listed senders

Revision as of 07:44, 28 July 2020 by Rnoti (talk | contribs) (Customized spam score for RBL listed Senders)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Customized spam score for RBL listed Senders


Add positive/negative spam score to the email if senders IP listed in the RBL's.


RBL's will work at the MTA (postfix) level, so if sender IP is listed in the RBL then the email is rejected by MTA (where RBL's enabled) without any notification. To allow email without compromising security check, disable RBL check at MTA level and enable at Amavis level (Spam assassin).

Steps to follow

  • Remove required RBL's at MTA level if enabled.
Note: If RBL's not enabled at MTA level then this step can be skipped.
  • Global level configuration.
    zmprov mcf -zimbraMtaRestriction "reject_rbl_client <RBL Address>"
zmprov mcf -zimbraMtaRestriction "reject_rbl_client"
  • Server level configuration
    zmprov ms `zmhostname` -zimbraMtaRestriction "reject_rbl_client <RBL Address>"
  • Edit spam assassin configuration file and add lines in below syntax for RBL lookup.
# /opt/zimbra/conf/
header CUSTOM_LOOKUP eval:check_rbl('zen','')
describe CUSTOM_LOOKUP Entries listed in RBL
Note: CUSTOM_LOOKUP is a key for this definition so keep this same for every line. 2.0 is a positive SPAM score, to give negative spam score use -2.0.
# Rule -1:
header CUSTOM_LOOKUP_5 eval:check_rbl('spam','')
describe CUSTOM_LOOKUP_5 Entries listed in RBL
score CUSTOM_LOOKUP_5 2.0
# Rule -2:
header CUSTOM_LOOKUP_6 eval:check_rbl('recent','')
describe CUSTOM_LOOKUP_6 Entries listed in RBL
score CUSTOM_LOOKUP_6 2.0
List of few RBL's
  • Restart Amavisd, MTA services.
zmamavisdctl restart
zmmtactl restart


The below is a sample message header when the sender IP is RBL listed.

X-Spam-Status: No, score=3.451 required=6 tests=[CUSTOM_LOOKUP_5=2, CUSTOM_LOOKUP_6=2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1]

Submitted by: Raghu Noti
Verified Against: ZCS 8.8.15, ZCS 9.0 Date Created: 2020-07-28
Article ID: Date Modified: 2020-07-28

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search