Where to add SpamAssassin Rules?

DWardCA

Member
Aug 12, 2017
11
0
1
Edmonton, Canada
cPanel Access Level
Root Administrator
What is the proper process for adding new scoring into cPanels' implementation of SpamAssassin. Its not clear which configuration files are actually used.

If I look in /etc/mail/spamassassin/CPANEL.cf I see this:

Code:
header          CPANEL_XYZ              From =~ /\@.*?\.xyz/i
describe        CPANEL_XYZ              .XYZ domain mostly used by spammers
score           CPANEL_XYZ              2.1
This is exactly what I want to add, but for the .date top-level domain. But I'm not sure which file to add it to .. /etc/mail/spamassassin/local.cf does not seem to be the same format as the CPANEL.cf - and I see some items in there that say they are auto-generated by cPanel which makes me believe there is another location.

Code:
# Emails from the .date TLD are automatically suspicious
header          CUSTTLD_DATE              From =~ /\@.*?\.date/i
describe        CUSTTLD_DATE              .DATE top-level domain mostly used by spammers
score           CUSTTLD_DATE              2.1
 

DWardCA

Member
Aug 12, 2017
11
0
1
Edmonton, Canada
cPanel Access Level
Root Administrator
I ran

/usr/local/cpanel/3rdparty/bin/spamassassin -D < spammsg.txt

In the debug messages I see two things which tell me that local.cf *IS* the correct place to add custom rules, and spamassassin is picking it up.

First, it shows:

config: read file /etc/mail/spamassassin/local.cf

Which verifies its local.cf file is correct....

And in the Content analysis details it now shows my custom rule:

2.1 CUSTTLD_DATE .date domain mostly used by spammers

So - yay .. I've successfully added a header rule.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
Hi @DWardCA

You can make customizations to the spamassassin global configuration by modifying /etc/mail/spamassassin/local.cf


As you just found! Thanks for updating, you beat me to it!