Author Topic: MarkasJunk2 cmd_learn on Centos, Cpanel, Exim  (Read 6507 times)

Offline stevebor1

  • Newbie
  • *
  • Posts: 1
MarkasJunk2 cmd_learn on Centos, Cpanel, Exim
« on: October 20, 2010, 04:28:54 PM »
What would be the correct 'markasjunk2_spam_cmd' , 'markasjunk2_ham_cmd'  path on a Centos Cpanel and Exim box? My learned tokens are 0 and that doesnt look right.

I have tried 'sa-learn --spam --username=%u %f';
Which gives me :

[20-Oct-2010 12:33:47 -0700]: sa-learn --spam --username=email@domain.com /var/cpanel/roundcube/tmp/rcmSALearnqGYSs5
[20-Oct-2010 12:33:47 -0700]: array (
  0 => 'Learned tokens from 0 message(s) (1 message(s) examined)',
)

and
'sa-learn --spam --prefs-file=/var/mail/%d/%l/.spamassassin/user_prefs %f'

Which gives me:
[20-Oct-2010 12:06:17 -0700]: sa-learn --spam --prefs-file=/var/mail/email@domain.com/email@domain.com/.spamassassin/user_prefs /var/cpanel/roundcube/tmp/rcmSALearnPEw6Ik
[20-Oct-2010 12:06:17 -0700]: array (
  0 => 'Learned tokens from 0 message(s) (1 message(s) examined)',
)

i looked into /var/mail/ and I don't have 'email@domain.com' but only have my domain account names as mail files like /var/mail/username.

The only place I have user_prefs file is at:
/home/username/.spamassassin/user_prefs

Any ideas on what my configuration should be?

Also, when I run sa-learn --dump all i get:
ERROR: Bayes dump returned an error, please re-run with -D for more information

Then when I run with -D i get
[19908] dbg: plugin: Mail::SpamAssassin::Plugin::Rule2XSBody=HASH(0x8b49fe4) implements 'finish_parsing_end', priority 0
[19908] dbg: replacetags: replacing tags
[19908] dbg: replacetags: done replacing tags
[19908] dbg: zoom: loading compiled ruleset from /var/lib/spamassassin/compiled/3.002004
[19908] dbg: zoom: using compiled ruleset in /var/lib/spamassassin/compiled/3.002004/Mail/SpamAssassin/CompiledRegexps/body_0.pm for Mail::SpamAssassin::CompiledRegexps::body_0
[19908] dbg: zoom: able to use 299/299 'body_0' compiled rules (100%)
[19908] dbg: bayes: no dbs present, cannot tie DB R/O: /root/.spamassassin/bayes_toks
[19908] dbg: config: score set 1 chosen.
[19908] dbg: bayes: no dbs present, cannot tie DB R/O: /root/.spamassassin/bayes_toks
ERROR: Bayes dump returned an error, please re-run with -D for more information
« Last Edit: October 20, 2010, 04:34:46 PM by stevebor1 »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
MarkasJunk2 cmd_learn on Centos, Cpanel, Exim
« Reply #1 on: October 21, 2010, 05:16:59 AM »
if you search this forum you'll find lots of examples and stuff about the sa-learn command. it looks like may be you need the --configpath option to set the correct location of the .spamassassin folder.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline cass

  • Newbie
  • *
  • Posts: 2
Re: MarkasJunk2 cmd_learn on Centos, Cpanel, Exim
« Reply #2 on: July 20, 2016, 06:24:17 AM »
Im running in the exact same problem.
Did you fixed it ?

How do you get the "username" (or "home directory") of cpanel account, instead of the email (%u), so you can build the command to obtain the /home/username/.spamassasin/user_prefs  ??

Let me know if you found the way to it.

Regards.