How to properly use sa-learn?

joako

Well-Known Member
Aug 7, 2003
112
2
168
cPanel Access Level
DataCenter Provider
I have one account that gets too much spam. I enable sa-lean in the spamassassin configuration and then run it against the mail directories. The sa-learn shows that the minimum of 200 spam and 200 ham have been processed, but in the inbound email headers there is no indication that it is being used.

What is the proper way to have sa-learn working for at least one account?
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
As commented on that link, the spam will keep coming, but good luck anyway.

Google the email address that's getting all the spam, do you find it? If yes, so do email scrapers. Over and over and over again. And, they'll send new spam to it using new email addresses fully passable by spam filtering emails.

Users need to learn to better obfuscate their email addresses on their own webpages, use secure contact forms, and should never ever post it anywhere if they can help it. But they don't.

If you want to end the spam on that email account quick and easy? Kill the email account when it gets that bad. Or, see if the results found on searching for the email via google, can be scrubbed from the websites you found it on.

Not the answer you were looking for, I'm sure. :rolleyes:
 

joako

Well-Known Member
Aug 7, 2003
112
2
168
cPanel Access Level
DataCenter Provider
When I read that documentation, it says to put in the config file:

bayes_path /var/spamassassin/bayes_db/bayes

But when I run sa-learn it creates /root/.spamassassin and in there is bayes_journal, bayes_seen, bayes_toks, and sa-compile.cache/. There is no bayes_db directory or any file called bayes.

In /etc/mail/spamassassin/local.cf I already put:

use_bayes 1
bayes_auto_learn 1

And I see for the users that have spamassassin enabled there is a ~/.spamassassin exactly like root's but still in the headers of received messages there is no indication that bayes is being used.
 

joako

Well-Known Member
Aug 7, 2003
112
2
168
cPanel Access Level
DataCenter Provider
How can I edit the scores assigned to particular spamassassin rules on a global basis, and ensure these changes survive any spam rules updates? For e.g. this rule I would like for it to be assigned more points:

1.7 RAZOR2_CHECK Listed in Razor2 (http://razor.sf.net/)
 

kdean

Well-Known Member
Oct 19, 2012
406
80
78
Orlando, FL
cPanel Access Level
Root Administrator
Edit /etc/mail/spamassassin/local.cf

Add:
score RAZOR2_CHECK #.#

# - your score numbers

Then restart spamd
/scripts/restartsrv_spamd

or restart Exim from WHM or with the following which will also restart spamd.
/scripts/restartsrv_exim
 

kdean

Well-Known Member
Oct 19, 2012
406
80
78
Orlando, FL
cPanel Access Level
Root Administrator
After activating Bayes, you need to wait until after a few hundred SPAM and HAM emails are received before it actually starts scoring the emails. So you should see the bayes files being created for the accounts, but may need to wait some time before seeing the effect.