cPanelResources

Tutorial How To Train SpamAssassin with SA-Learn

cPanelResources

Staff
Staff member
Apr 27, 2015
112
77
153
Houston, TX
cPanel Access Level
DataCenter Provider
cPanelResources submitted a new resource:

How To Train SpamAssassin with SA-Learn - Identify more SPAM with SpamAssassin's sa-learn utility.

Overview
This tutorial includes instructions for using SpamAssassin's sa-learn utility to identify and catch more SPAM.

Important Notes
1. The instructions in this tutorial were tested on a server running CentOS 7.6 and cPanel & WHM version 78. However, the commands and examples provided in this tutorial should work with any supported version of cPanel and WHM as well as any supported version of CentOS, Red Hat, or CloudLinux.

2. The instructions in this tutorial are...
Read more about this resource...
 

renecd

Member
Mar 26, 2020
9
1
1
badland-vibes-tackiness-handoff
cPanel Access Level
DataCenter Provider
Interesting. Surprised there has been no reactions at all to this. Spam is still a big problem. For years I resorted to using Gmail who have got the spam situation 99.99% under control, but unfortunately the side effects have made me reevaluate hosting my own mail again, but it's an uphill battle.

Some questions to this tutorial:

1) Since a bayes_seen and bayes_toks already exist in my .spamassassin folder, something must already be running sa-learn on cpanel servers? I'd like to know what, so I don't conflict that with my own jobs. I don't see anything in root's crontab.

2) Once sa-learn has run on the spam folder, is there a way to have it delete the checked mail? Either directly through sa-learn, or some other way? Does it make sense?
 

AndyB78

Well-Known Member
Oct 7, 2003
80
2
158
Romania
cPanel Access Level
Root Administrator
Interesting. Surprised there has been no reactions at all to this. Spam is still a big problem.
Doesn't seem all that surprising as sa-learn is not a cPanel feature but a SA feature. cPanel is a GUI interface usually used by people that know nothing about SSH and wouldn't care less. If the users need to know how to use putty or the server admin needs to do this for them, this completely defeats the purpose of cPanel. So this is in no way relevant (specifically at least) to the cPanel ecosystem.

When we'll have Spam/Ham buttons in cPanel (maybe in a native cPanel webmail app), like most free mail providers offer for a very long time, then sa-learn will be relevant to cPanel. IMO this is a feature that should have been developed by cPanel long time ago. At least before the first price increase. Or at the very least before the new (Jan 1st 2021) one as we can see a significant upsurge in spam volumes and especially virus mail propagation techniques.
 

DeviC3

Member
Mar 28, 2021
13
0
1
Poland
cPanel Access Level
Website Owner
Hi, great tutorial, I need to make sure if I understand this. The changes made by sa-learn is active only for USER not globally?
This line of command:
Code:
/home/USER/.spamassassin/user_prefs
tells us to do this only for this usern not the other right ?
 

Curious Too

Well-Known Member
Aug 31, 2001
432
1
318
cPanel Access Level
Root Administrator
I have a user who setup a cron job for sa-learn using the tutorial here. It works except lately it's returning the following message:

info [sa-learn] Locale needs to be compiled by root (/usr/local/cpanel/bin/build_locale_databases --locale=en)

Is this something we should be concerned about?
 

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
I have a user who setup a cron job for sa-learn using the tutorial here. It works except lately it's returning the following message:

info [sa-learn] Locale needs to be compiled by root (/usr/local/cpanel/bin/build_locale_databases --locale=en)

Is this something we should be concerned about?
I have this exact same problem on two of my accounts. Was there any progress with the ticket? (Edit: I've been using sa-learn on cPanel accounts for some years, with shell scripts to parse the .spam directories and additional "ham" directories)

Same error, since July 8th this year:

info [sa-learn] Locale needs to be compiled by root (/usr/local/cpanel/bin/build_locale_databases --locale=en)

and also, since August 26th:

netset: cannot include 184.154.xx.xxx/32 as it has already been included
netset: cannot include 198.143.xxx.xx/32 as it has already been included
 
Last edited:

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
Follow up: the provider has raised a ticket, (edit #94381616) and been told that these are informational notices only, and don't affect the operation of sa-learn.

I understand that these are info messages, but:

Shouldn't the locale be compiled automatically when needed?

I understand the "netset" error is caused by an entry in the "trusted networks" line in /etc/mail/spamassassin. Again, should this line not be updated automatically by the regular cPanel updates? (It does say # Autoconfigured by cPanel at the end of the line)
 
Last edited:

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
I am told that there has been some sort of breakthrough, and the support guys have discovered the problem causing the locale error.

Additionally, deleting the trusted_networks line in /etc/mail/spamassassin/local.cf eliminates the netset error message. Apparently this line is no longer required(?)