[SOLVED] SpamAssassin custom rules (/etc/mail/spamassassin/custom.cf) are not working

fernoliv

Well-Known Member
Sep 30, 2018
31
15
48
42
Hi there,

I have hundreds of SpamAssassin custom rules on the file /etc/mail/spamassassin/custom.cf (see the attached picture). It is being used to filter the header (subject) but it is not adding the scores or matching the strings anymore.

I'm using the latest PMG (proxmox-mailgateway: 6.4-1 (API: 6.4-3/225ecb80, running kernel: 5.4.106-1-pve).

Do you guys think that is due the upgrade from 6.3 to 6.4? Are the SpamAssassin paths the same of before or now we have new files doing that?

Thank you so much for your help.
 

Attachments

  • Captura de Tela 2021-04-16 às 08.44.46.png
    Captura de Tela 2021-04-16 às 08.44.46.png
    82 KB · Views: 142
Nothing should have changed with that upgrade ...

please run `spamassassin --lint -D all 2>&1` to see if the file gets read by spamassassin (you should both see 'custom.cf' in the output and probably also some of your rule-names)

I hope this helps!
 
There's no need to use templates, the file extension just needs to be .cf and it needs to be located in the /etc/mail/spamassassin/ directory.

What matters is that the rule is correct; pay close attention when creating it to never leave an incorrect parameter, because once one is wrong, this line will be applied to all received emails. Below are examples of rules by topic and also content within the body.


Code:
header      SUBJECT001 Subject =~ /\byou win loto|viagra pills|free sex|sexual machine/i
score       SUBJECT001 8.0
describe    SUBJECT001 Subject spam 001

body        BODYSPAM001 /you win loto|viagra pills|free sex|sexual machine/i
score       BODYSPAM001 3.0
describe    BODYSPAM001 Body spam 001