Customized spam score for RBL listed senders: Difference between revisions

(Created page with "=Customized spam score for RBL listed Senders= <hr> {{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 9.0}}|}} {{WIP}} ====Requirement==== Add positive/negative spam score to the email if...")
 
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
__FORCETOC__
=Customized spam score for RBL listed Senders=  
=Customized spam score for RBL listed Senders=  
<hr>
{{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 9.0}}|}}  
{{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 9.0}}|}}
====Problem====
{{WIP}} 
Add positive/negative spam score to the email if senders IP listed in the RBLs.


====Description====
RBLs will work at MTA(postfix) level so, if sender IP is listed in the RBL then the email will be rejected by MTA (when RBLs enabled) without any notification to the recipient. To allow email without compromising security check, disable RBL check at MTA level and enable at Amavis level (Spam assassin).


====Requirement====
====Steps to follow====
Add positive/negative spam score to the email if senders IP listed in the RBL's.
'''NOTE: This is a customization and needs to be tested first on the test environment before implementing on production. Also these changes may not survive an upgrade.'''


====Description====
'''Step 1:'''
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).  
* Remove required RBLs at MTA level if enabled.
: Note: If RBLs not enabled at MTA level then this step can be skipped.  


=====Steps to follow=====
* Global level configuration.
:<pre>zmprov mcf -zimbraMtaRestriction "reject_rbl_client <RBL Address>"</pre>
:Example:
:zmprov mcf -zimbraMtaRestriction "reject_rbl_client xbl.spamhaus.org"


======Step-1======
* Server level configuration
:<pre>zmprov ms `zmhostname` -zimbraMtaRestriction "reject_rbl_client <RBL Address>"</pre>


* Remove required RBL's at MTA level if enabled.
'''Step 2:'''
: Note: If RBL's not enabled at MTA level then this step can be skipped.  
* Edit spam assassin configuration file <code>/opt/zimbra/conf/salocal.cf.in</code>, and add lines in below syntax for RBL lookup.
:<pre>header CUSTOM_LOOKUP eval:check_rbl('<RBL name>','<RBL Address>')&#10;describe CUSTOM_LOOKUP Entries listed in <RBL Address> RBL&#10;score CUSTOM_LOOKUP <Score></pre>
 
: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.


* Global level configuration.
:'''Examples:'''
*:<pre>zmprov mcf -zimbraMtaRestriction "reject_rbl_client <RBL Address>"</pre>
:Rule -1:
:: i.e.:
:header CUSTOM_LOOKUP_5 eval:check_rbl('spam','spam.dnsbl.sorbs.net.')
:: zmprov mcf -zimbraMtaRestriction "reject_rbl_client xbl.spamhaus.org"
:describe CUSTOM_LOOKUP_5 Entries listed in spam.dnsbl.sorbs.net RBL
:score CUSTOM_LOOKUP_5 2.0


* Server level configuration
:Rule -2:
*:<pre>zmprov ms `zmhostname` -zimbraMtaRestriction "reject_rbl_client <RBL Address>"</pre>
:header CUSTOM_LOOKUP_6 eval:check_rbl('recent','recent.spam.dnsbl.sorbs.net.')
:describe CUSTOM_LOOKUP_6 Entries listed in recent.dnsbl.sorbs.net RBL
:score CUSTOM_LOOKUP_6 -2.0


'''Step 3:'''
* Restart Amavisd, MTA services.
:<pre>zmamavisdctl restart&#10;zmmtactl restart</pre>


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


======Step 2====== 
''X-Spam-Status: No, score=1.451 required=6 tests=['''CUSTOM_LOOKUP_5=2, CUSTOM_LOOKUP_6=-2''', DKIM_SIGNED=0.1, DKIM_VALID=-0.1]''
# This is a numbered list
# The second step is here
## This is a nested step
## Over here as well
# The original list then continues


: This is an indent
:: This is a double indent
This [https://www.mediawiki.org/wiki/Help:Formatting external link] contains more information about formatting.


{{SubmittedBy|Author name}}
{{SubmittedBy|Raghu Noti}}


{{Article Footer|ZCS 8.8|2020-04-13}}
{{Article Footer|ZCS 8.8.15, ZCS 9.0|2020-07-28}}

Latest revision as of 05:26, 6 April 2022

Customized spam score for RBL listed Senders

   KB 24126        Last updated on 2022-04-6  




0.00
(0 votes)

Problem

Add positive/negative spam score to the email if senders IP listed in the RBLs.

Description

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

Steps to follow

NOTE: This is a customization and needs to be tested first on the test environment before implementing on production. Also these changes may not survive an upgrade.

Step 1:

  • Remove required RBLs at MTA level if enabled.
Note: If RBLs not enabled at MTA level then this step can be skipped.
  • Global level configuration.
zmprov mcf -zimbraMtaRestriction "reject_rbl_client <RBL Address>"
Example:
zmprov mcf -zimbraMtaRestriction "reject_rbl_client xbl.spamhaus.org"
  • Server level configuration
zmprov ms `zmhostname` -zimbraMtaRestriction "reject_rbl_client <RBL Address>"

Step 2:

  • Edit spam assassin configuration file /opt/zimbra/conf/salocal.cf.in, and add lines in below syntax for RBL lookup.
header CUSTOM_LOOKUP eval:check_rbl('<RBL name>','<RBL Address>')
describe CUSTOM_LOOKUP Entries listed in <RBL Address> RBL
score CUSTOM_LOOKUP <Score>
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.
Examples:
Rule -1:
header CUSTOM_LOOKUP_5 eval:check_rbl('spam','spam.dnsbl.sorbs.net.')
describe CUSTOM_LOOKUP_5 Entries listed in spam.dnsbl.sorbs.net RBL
score CUSTOM_LOOKUP_5 2.0
Rule -2:
header CUSTOM_LOOKUP_6 eval:check_rbl('recent','recent.spam.dnsbl.sorbs.net.')
describe CUSTOM_LOOKUP_6 Entries listed in recent.dnsbl.sorbs.net RBL
score CUSTOM_LOOKUP_6 -2.0

Step 3:

  • Restart Amavisd, MTA services.
zmamavisdctl restart
zmmtactl restart

Validation

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

X-Spam-Status: No, score=1.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: https://wiki.zimbra.com/index.php?title=Customized_spam_score_for_RBL_listed_senders Date Modified: 2022-04-06



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