Koozali.org: home of the SME Server

Correct way to edit/add Spam Filter Rules so update will not overwrite?

Offline drurydj

  • *
  • 8
  • +0/-0
    • http://www.hvacc.net
What is the correct way to edit the SARE_ADULT2 filter to up its score from 1.4 to 20?   A nudge in the right direction would be appreciated.

Intent is any match of this rule is automatic reject?   Would it be correct to define my own rule to do this?  (As in I think the contents of this folder are updated with sa-update)

Editing the file /var/lib/spamassassin/3.002003/saupdates_openprotect_com

Ex: (I added <content removed> that was missed, and raised score from 1.4 to 20).

body     SARE_ADULT2 <content removed>
describe SARE_ADULT2 Contains adult material
score    SARE_ADULT2 20
# Original name: MY_XXX_BODY, was rawbody
#  9985s/30h of 119325 corpus (98981s/20344h) 03/21/04
#  683s/2h of 15929 corpus (13729s/2200h) 03/23/04
#counts   SARE_ADULT2              4729s/9h of 42056 corpus (34127s/7929h FVGT) 04/19/06
#counts   SARE_ADULT2              2685s/34h of 140226 corpus (90162s/50064h DOC) 04/19/06

Content preview:  <content removed>

Content analysis details:   (47.4 points, 4.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 3.2 FROM_LOCAL_NOVOWEL     From: localpart has series of non-vowel letters
 2.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net
                  [Blocked - see <http://www.spamcop.net/bl.shtml?87.9.255.8>]
 1.6 RCVD_IN_SORBS_DUL      RBL: SORBS: sent directly from dynamic IP address
                            [87.9.255.8 listed in dnsbl.sorbs.net]
 0.5 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                            [87.9.255.8 listed in zen.spamhaus.org]
 0.0 FRT_BIGGERMEM1         BODY: ReplaceTags: Bigger / Larger, Penis / Member
 1.6 BODY_ENHANCEMENT       BODY: Information on growing body parts
  20 SARE_ADULT2            BODY: Contains adult material
 0.0 HTML_MESSAGE           BODY: HTML included in message
 1.5 RAZOR2_CF_RANGE_E8_51_100 Razor2 gives engine 8 confidence level
                            above 50%
                            [cf: 100]
 0.5 RAZOR2_CHECK           Listed in Razor2 (http://razor.sf.net/)
 0.5 RAZOR2_CF_RANGE_51_100 Razor2 gives confidence level above 50%
                            [cf: 100]
 2.0 URIBL_BLACK            Contains an URL listed in the URIBL blacklist
                            [URIs: meblepl.com]
 1.6 URIBL_AB_SURBL         Contains an URL listed in the AB SURBL blocklist
                            [URIs: meblepl.com]
 2.1 URIBL_WS_SURBL         Contains an URL listed in the WS SURBL blocklist
                            [URIs: meblepl.com]
 2.9 URIBL_JP_SURBL         Contains an URL listed in the JP SURBL blocklist
                            [URIs: meblepl.com]
 2.1 URIBL_OB_SURBL         Contains an URL listed in the OB SURBL blocklist
                            [URIs: meblepl.com]
 2.5 URIBL_SC_SURBL         Contains an URL listed in the SC SURBL blocklist
                            [URIs: meblepl.com]
 2.5 URIBL_SBL              Contains an URL listed in the SBL blocklist
                            [URIs: meblepl.com]
 0.1 RDNS_DYNAMIC           Delivered to trusted network by host with
                            dynamic-looking rDNS
« Last Edit: September 04, 2007, 04:45:12 PM by slords »

Offline drurydj

  • *
  • 8
  • +0/-0
    • http://www.hvacc.net
Re: Correct way to edit/add Spam Filter Rules so update will not overwrite?
« Reply #1 on: September 04, 2007, 02:10:15 PM »
Answer = You can't modify someone elses rule -- define a local rule.  Put local rule in /etc/mail/spamassassin

From Spam Assassian Wiki
"Local configurations should go in the site-specific area - typically /etc/mail/spamassassin or /etc/spamassassin. All files in this directory matching *.cf will be processed in lexical order."

Thanks.
Dan


Offline mmccarn

  • *
  • 2,657
  • +10/-0
Re: Correct way to edit/add Spam Filter Rules so update will not overwrite?
« Reply #2 on: September 09, 2007, 06:31:50 PM »
Quote from: drurydj
What is the correct way to edit the SARE_ADULT2 filter to up its score from 1.4 to 20?
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf
cd /etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf
echo "score SARE_ADULT2 20.000" >> 20localscores
signal-event email-update

Add custom scores for other plugins by editing 20localscores:
Code: [Select]
pico -w /etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf/20localscores
signal-event email-update

Un-do these changes by removing the custom template fragment:
Code: [Select]
rm -f /etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf/20localscores
signal-event email-update

Reference: http://spamassassin.apache.org/full/3.1.x/dist/doc/Mail_SpamAssassin_Conf.html#scoring_options

(Added to Email HowTo: http://wiki.contribs.org/Email#Custom_Rule_Scores)
« Last Edit: September 09, 2007, 07:40:35 PM by mmccarn »

Offline drurydj

  • *
  • 8
  • +0/-0
    • http://www.hvacc.net
Re: Correct way to edit/add Spam Filter Rules so update will not overwrite?
« Reply #3 on: September 10, 2007, 11:26:04 AM »
Thank you.