How to modify existing spamassassin rule scores?

Want some informations on MailCleaner internals ?

Moderators: Pascal, mentor, FlorianB, bourgeois

meat1oaf
Posts: 10
Joined: Mon Sep 24, 2012 3:08 pm
How did you hear about Mailcleaner: google

How to modify existing spamassassin rule scores?

Postby meat1oaf » Tue Apr 30, 2013 5:29 pm

I have been able to successfully add new rules and corresponding scores by creating a file called 99_custom.cf in /usr/mailcleaner/share/spamassassin

However I have been unsuccessful in modifying scores for EXISTING rules.

It was my understanding that if I wanted to change a rule (say for example, set the score of RDNS_NONE to 1.5), i should create a local.cf file in the above folder and add the following line:

Code: Select all

score RDNS_NONE     1.5


However, after restarting mailcleaner, my runs of is_spam still show the score as the original 1.3.

What am I dong wrong? :-)
Thanks!
MatthewW
Posts: 31
Joined: Fri Apr 19, 2013 2:24 pm
How did you hear about Mailcleaner: google

Re: How to modify existing spamassassin rule scores?

Postby MatthewW » Tue Apr 30, 2013 5:56 pm

Spamassassin processes rules files in alphabetical order: http://www.informit.com/articles/article.aspx?p=375704&seqNum=6
In my installation I notice that RDNS_NONE has a score listed in 50_scores.cf under an updates folder. This file is included back in the main folder in a file called updates_spamassassin_org.cf
So it would appear that your file is giving the score too early in the process. It is too bad that mailcleaner doesn't use the standard spamassassin configuration which calls for keeping your local.cf file in a different folder which is read after the normal config folder.
If I am correct about the cause of your problem, you could put your custom score in a file called zzzlocal.cf as a solution.
meat1oaf
Posts: 10
Joined: Mon Sep 24, 2012 3:08 pm
How did you hear about Mailcleaner: google

Re: How to modify existing spamassassin rule scores?

Postby meat1oaf » Tue Apr 30, 2013 6:00 pm

It Worked! Thanks so much!
cglmicro
Posts: 291
Joined: Thu Mar 07, 2013 2:12 am
How did you hear about Mailcleaner: google

Re: How to modify existing spamassassin rule scores?

Postby cglmicro » Wed Mar 16, 2016 12:29 pm

Sorry to wake this old thread, but it's not working for me either, also to increase value or RDNS_NONE from 0.8 to 1.1.

I did put and named my file /usr/mailcleaner/share/spamassassin/ZZcglmicro_custom_rules.cf and it contain:

Code: Select all

# RÈGLES AJOUTÉES PAR CGL

# LE 22/11/2015:
# spam.dnsbl.anonmails.de
header RCVD_IN_ANONMAILS        eval:check_rbl('anonmails-lastexternal', 'spam.dnsbl.anonmails.de.')
describe RCVD_IN_ANONMAILS      Relay is listed in spam.dnsbl.anonmails.de
tflags RCVD_IN_ANONMAILS        net
score RCVD_IN_ANONMAILS         2.0

# Le 15/3/2106
# pour augmenter rejet RDNS
score RDNS_NONE 1.1
score URIBL_BLOCKED 1.1

# Test
score RCVD_IN_HOSTKARMA_YE 0.1


Then I did an /etc/init.d/mailcleaner restart.

This morning, I still received a spam with this RDNS_NONE=0.8 in the header:

Code: Select all

Received: from ABPSRV12.groupeabp.local (192.168.130.4) by
 ABPSRV12.groupeabp.local (192.168.130.4) with Microsoft SMTP Server (TLS) id
 15.0.913.22 via Mailbox Transport; Wed, 16 Mar 2016 05:56:50 -0400
Received: from mc137.legardeur.net (192.99.47.137) by ABPSRV12.groupeabp.local
 (192.168.130.4) with Microsoft SMTP Server (TLS) id 15.0.913.22; Wed, 16 Mar
 2016 05:56:49 -0400
Received: from [45.59.115.24] (helo=003ab970.trakphouds.xyz)
   by mc137.legardeur.net stage1 with esmtp
   (Exim MailCleaner)
   id 1ag8C4-00048h-4S
   for <csozzani@abplocation.com>
   from <TedsWoodworking@trakphouds.xyz>; Wed, 16 Mar 2016 05:56:44 -0400
Received: from 003ab970.blowline.trakphouds.xyz ([127.0.0.1]:11754 helo=blowline.trakphouds.xyz)
   by blowline.trakphouds.xyz with ESMTP id 00RKJQ3AB9NNGQ70;
   for <csozzani@abplocation.com>; Wed, 16 Mar 2016 02:56:43 -0700
X-MailCleaner-SPF: pass
Message-ID: <77542823840806775430672964880810193@blowline.trakphouds.xyz>
Importance: Normal
To: <csozzani@abplocation.com>
From: TedsWoodworking <TedsWoodworking@trakphouds.xyz>
Subject: Woodworking Made Easy With TedsWoodworking
Date: Wed, 16 Mar 2016 02:56:43 -0700
X-Priority: 3 (Normal)
Content-Language: en-us
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: multipart/alternative;
   boundary="----=Part.818.9463.1458122203"
X-MailCleaner-RDNS: invalid reverse DNS for 45.59.115.24
X-NiceBayes: disabled (no database ?)
X-Spamc: is not spam (score=2.4, required=5.0)
X-MailCleaner-Information: Please contact info@cglmicro.ca for more information
X-MailCleaner-ID: 1ag8C4-00048l-Er
X-MailCleaner: Found to be clean
=======================================================================================
======= HERE ===========================================================================
=======================================================================================
X-MailCleaner-SpamCheck: not spam, Spamc (score=2.4, required=5.0,
   T_KAM_HTML_FONT_INVALID 0.0, DCC_CHECK 1.1, RDNS_NONE 0.8,
   BAYES_00 -1.9, HTML_MESSAGE 0.0, HEXHASH_WORD 2.2,
   HTML_FONT_LOW_CONTRAST 0.0, KAM_LOTSOFHASH 0.2, T_REMOTE_IMAGE 0.0)
=======================================================================================
=======================================================================================
=======================================================================================
X-MailCleaner-ReportURL: https://mc170.legardeur.net/rs.php
Return-Path: TedsWoodworking@trakphouds.xyz
X-MS-Exchange-Organization-Network-Message-Id: b0c0634a-3bff-4413-0573-08d34d814b14
X-MS-Exchange-Organization-AVStamp-Enterprise: 1.0
X-C2ProcessedOrg: d10fb929-7371-4e0d-8f9c-108105f12d21
X-MS-Exchange-Organization-AuthSource: ABPSRV12.groupeabp.local
X-MS-Exchange-Organization-AuthAs: Anonymous


What do I miss ?
FlorianB
Posts: 296
Joined: Wed Apr 01, 2015 2:27 pm
How did you hear about Mailcleaner: job

Re: How to modify existing spamassassin rule scores?

Postby FlorianB » Tue May 03, 2016 2:58 pm

Hello,
Good question ! We use the same thing for custom SA rules and some others in others threads too so i suppose a previous rules break anything (can't find an error but...).
Try to backup this file, recreate a zzCustomRules.cf then fill it with only one line of SCORE.
Restart filtering then test.
Fill it until everything works (or explode...).
PS: Think to check if you didnt already do this with a zzzzFILE.cf that overwrite your score, would be sad.
Best regards,
Florian Billebault
MailCleaner Team
cglmicro
Posts: 291
Joined: Thu Mar 07, 2013 2:12 am
How did you hear about Mailcleaner: google

Re: How to modify existing spamassassin rule scores?

Postby cglmicro » Fri May 06, 2016 10:24 pm

Thanks, but no luck.

Return to “Questions”

Who is online

Users browsing this forum: No registered users and 2 guests