Adding rules to spamassassin/configserver.cf have no effect.

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Hi, I've asked this question at configserver.com a few days ago, but so far no response. So I am wondering if anyone here, can shed some light?

I have also combed through all the SA on-line docs and form posts that I can find, still no joy.

I am not trying to block, but just elevate the overall SA score if email is sent from certain TLDs.

I've read all the form/group posts and spamassassin instructions pages I can find, but still there's no mention of these new scores in any new headers that I can find (that is sending from one of these domains).

Here are the new rules I have added to:

/etc/mail/spamassassin/configserver.cf

header LOCAL_LS_FROM_DOT_ME ALL =~ /*\.me/i
score LOCAL_LS_FROM_DOT_ME 2.1

header LOCAL_LS__FROM_DOT_US ALL =~ /*\.us/i
score LOCAL_LS_FROM_DOT_US 1.6

header LOCAL_LS_FROM_DOT_RU ALL =~ /*\.ru/i
score LOCAL_LS_FROM_DOT_RU 2.2

header LOCAL_LS_FROM_DOT_RO ALL =~ /*\.ro/i
score LOCAL_LS_FROM_DOT_RO 2.2



Do these look okay? Should I restart spamassassin somehow in order for these to take effect, if so, then how would I do this, out side of restarting WHMCS --> Mailscanner

Thanks much.

Also, I found instructions to run the following after making a rule change to check for errors:

spamassassin --lint

But this does not work at shell. I've searched for a spamassassin binary, so that I may run this command, but can find none.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello :)

Have you tried implementing a custom rule like this on an environment without a third-party application such as MailScanner installed? You may want to temporarily disable MailScanner and try implementing the rules directly with SpamAsassin. As for the rules themselves, I will leave this thread open for user-feedback regarding the best way to implement rules like this.

Thank you.
 

serichards

Well-Known Member
Dec 11, 2012
48
0
6
cPanel Access Level
Website Owner
When I look on my centos installation it tells me spamassassin is in /usr/local/bin

I used the which command. Installing mailscanner may lead to spamassassin being moved elsewhere.

Found on another forum that mailscanner could put them in: Try creating your rules in /usr/mailcleaner/share/spamassassin instead.


Also if the whitelist/blacklist shortcircuit plugin is being used then could be skipping checking those if those domains are already in a blacklist.
 

kdean

Well-Known Member
Oct 19, 2012
312
32
28
Orlando, FL
cPanel Access Level
Root Administrator
Not familiar with what changes Mailscanner applies, but with the default cPanel installed spamassassin I just edit my config here:

/etc/mail/spamassassin/local.cf
 

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Thanks for the help folks, I really appreciate it.

According to ConfigServer I should be able to enter the rules where I did:

/etc/mail/spamassassin/configserver.cf

... and everything should be just fine. I will continue to research the best location for this, but do the rules themselves look okay?
 

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Thanks again folks. I ended up putting the rules at the following per one of the suggestions above:

/etc/mail/spamassassin/local.cf

And if anybody is interested, here's what I found works well:

If you want to add SA scoring to any email where there is a Russian email address in the header, then just use something like this:

header FROM_DOT_RU ALL =~ /\[email protected]{1,25}\.ru\b/i
score FROM_DOT_RU 2.20