Spamassassin sa-learn not working

Operating System & Version
Cloudlinux 8
cPanel & WHM Version
11.106.0.15

Fbarajas

Well-Known Member
Jul 15, 2004
65
5
158
Playa del Carmen, Mexico
Hi! I'm trying to use sa-learn, and I get this error:


[[email protected] spamassassin]# /usr/local/cpanel/3rdparty/bin/sa-learn --dump magic
ERROR: Bayes dump returned an error, please re-run with -D for more information

Then, I tried with the -D option, and I get a VERY long list, but I think this are the important parts:


Feb 17 10:54:49.326 [891020] dbg: config: warning: no description set for KAM_RPTR_PASSED
Feb 17 10:54:49.326 [891020] dbg: config: warning: no description set for DOS_DEREK_AUG08
Feb 17 10:54:49.326 [891020] dbg: config: warning: no description set for CURR_PRICE
Feb 17 10:54:49.326 [891020] dbg: config: warning: no description set for BASE64_LENGTH_78_79
Feb 17 10:54:49.326 [891020] dbg: config: warning: no description set for HTML_TITLE_SUBJ_DIFF
Feb 17 10:54:49.326 [891020] dbg: config: warning: no description set for LM_WINDDIFFERENT_SPAMMER_VIA_GMAIL
Feb 17 10:54:49.326 [891020] dbg: config: warning: no description set for JM_TORA_XM
Feb 17 10:54:49.327 [891020] dbg: config: warning: no description set for HELO_FRIEND
[...]
Feb 17 10:54:49.336 [891020] dbg: config: warning: no description set for HK_LOTTO
Feb 17 10:54:49.336 [891020] dbg: config: warning: no description set for URI_ADOBESPARK
Feb 17 10:54:49.336 [891020] dbg: config: warning: no description set for FSL_FAKE_HOTMAIL_RVCD
Feb 17 10:54:49.336 [891020] dbg: config: warning: no description set for KAM_IFRAME
[...]

Feb 17 10:54:50.374 [891020] dbg: zoom: using compiled ruleset in /var/lib/spamassassin/compiled/5.032/3.004004/Mail/SpamAssassin/CompiledRegexps/body_neg2000.pm for Mail::SpamAssassin::CompiledRegexps::body_neg2000
Feb 17 10:54:50.374 [891020] dbg: zoom: no usable compiled rules for type body_neg2000
Feb 17 10:54:50.380 [891020] dbg: zoom: using compiled ruleset in /var/lib/spamassassin/compiled/5.032/3.004004/Mail/SpamAssassin/CompiledRegexps/body_0.pm for Mail::SpamAssassin::CompiledRegexps::body_0
Feb 17 10:54:50.388 [891020] dbg: zoom: skipping rule __KAM_COMPROMISED3, code differs in compiled ruleset '\d{1,2}[\\/]\d{1,2}[\\/]\d{2,4} \d{1,2}\:\d{1,2}\:\d{1,2} (AM|PM)' '\d{1,2}[\\\/]\d{1,2}[\\\/]\d{2,4} \d{1,2}\:\d{1,2}\:\d{1,2} (AM|PM)'
Feb 17 10:54:50.394 [891020] dbg: zoom: skipping rule LM_DRUG_PUSHER_TAG, code differs in compiled ruleset '\<P\stitle\=3D\"\"\>\d{2}\:\d{2}\:\d{2}\s\d{2}\.\d{2}\.\d{4}\s\<\/P\>' '\<P\stitle\=3D\"\"\>\d{2}\:\d{2}\:\d{2}\s\d{2}\.\d{2}\.\d{4}\s\\<\/P\>'
Feb 17 10:54:50.401 [891020] dbg: zoom: able to use 4819/4821 'body_0' compiled rules (99.958%)
Feb 17 10:54:50.401 [891020] dbg: FreeMail: loaded freemail_domains entries: 2552 normal, 28 wildcard
Feb 17 10:54:50.401 [891020] dbg: FreeMail: initializing email regex
Feb 17 10:54:50.408 [891020] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x4a9f920) implements 'learner_new', priority 0
Feb 17 10:54:50.409 [891020] dbg: bayes: learner_new self=Mail::SpamAssassin::Plugin::Bayes=HASH(0x4a9f920), bayes_store_module=Mail::SpamAssassin::BayesStore::DBM
Feb 17 10:54:50.420 [891020] dbg: bayes: learner_new: got store=Mail::SpamAssassin::BayesStore::DBM=HASH(0x50c8240)
Feb 17 10:54:50.420 [891020] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x4a9f920) implements 'learner_is_scan_available', priority 0
Feb 17 10:54:50.429 [891020] dbg: bayes: no dbs present, cannot tie DB R/O: /root/.spamassassin/bayes_toks
Feb 17 10:54:50.429 [891020] dbg: config: score set 1 chosen.
Feb 17 10:54:50.432 [891020] dbg: dns: EDNS, UDP payload size 4096
Feb 17 10:54:50.432 [891020] dbg: dns: servers obtained from Net::DNS : [1.1.1.1]:53, [4.2.2.2]:53, [8.8.8.8]:53
Feb 17 10:54:50.432 [891020] dbg: dns: nameservers set to 1.1.1.1, 4.2.2.2, 8.8.8.8
Feb 17 10:54:50.432 [891020] dbg: dns: using socket module: IO::Socket::IP version 0.41
Feb 17 10:54:50.432 [891020] dbg: dns: is Net::DNS::Resolver available? yes
Feb 17 10:54:50.432 [891020] dbg: dns: Net::DNS version: 1.28
Feb 17 10:54:50.432 [891020] dbg: sa-learn: spamtest initialized
Feb 17 10:54:50.433 [891020] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x4a9f920) implements 'learner_dump_database', priority 0
Feb 17 10:54:50.436 [891020] dbg: bayes: no dbs present, cannot tie DB R/O: /root/.spamassassin/bayes_toks
Feb 17 10:54:50.438 [891020] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x4a9f920) implements 'learner_close', priority 0

How can I fix this?

Thanks!
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,163
2,410
363
cPanel Access Level
Root Administrator
Hey there! I believe you are seeing normal output when that command is run as the root user, as these are designed to be run as an individual cPanel user. More details on those commands and the various options can be found here:


but point number three on that page says this:

Code:
3. You must login as the cPanel user when connecting to your server via SSH in order to successfully execute the sa-learn commands included in this tutorial.  See our How To Access The Command Line document for more information on how to login as a specific user. Alternatively, you can use the following su command to initiate a user SSH session from an existing root SSH session: