You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Massimiliano Marini <ma...@linuxtime.it> on 2008/09/14 14:23:26 UTC

sa-learn and different parh

Hi all,

my SA version: 3.2.4

when launching this command, I noticed that the files are updated in
two different folders.

user: root
foo:~# sa-learn --sync --spam --mbox /home/foo/spam.mbox

/root/.spamassassin/bayes_seen
/root/.spamassassin/bayes_toks

/home/spamassassin/.spamassassin/auto-whitelist
/home/spamassassin/.spamassassin/bayes_journal

Why? I don't think it's the right way.

My local.cf:

rewrite_header Subject ****SPAM(_SCORE_)****
report_safe 0
required_score 4.0

## I've tried to uncomment and re-launch spamd but don't work
#bayes_path /etc/mail/spamassassin/bayes
#bayes_file_mode 0770

use_bayes 1
bayes_auto_learn 1
bayes_auto_expire 0
bayes_learn_to_journal 1
bayes_journal_max_size 0

-- 
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it."  -- Alan Kay

Re: sa-learn and different path

Posted by Massimiliano Marini <ma...@linuxtime.it>.
Any hint?

-- 
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it."  -- Alan Kay

Re: sa-learn and different parh

Posted by Massimiliano Marini <ma...@linuxtime.it>.
Hi Matt,

> su yourself to the spamassassin user before performing sa-learn calls.

Thanks 1K hor your help :)
-- 
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it."  -- Alan Kay

Re: sa-learn and different parh

Posted by Matt Kettler <mk...@verizon.net>.
Massimiliano Marini wrote:
> Hi all,
>
> my SA version: 3.2.4
>
> when launching this command, I noticed that the files are updated in
> two different folders.
>
> user: root
> foo:~# sa-learn --sync --spam --mbox /home/foo/spam.mbox
>
> /root/.spamassassin/bayes_seen
> /root/.spamassassin/bayes_toks
>
> /home/spamassassin/.spamassassin/auto-whitelist
> /home/spamassassin/.spamassassin/bayes_journal
>
> Why? I don't think it's the right way.
>   
Coincidence. The files in /home/spamassassin is being updated by
incoming mail, the files in /root is being updated by sa-learn. The key
here is sa-learn does *NOT* update the auto-whitelist file, so that
indicates it must be happening via inbound mail. 

However, this does suggest you're running sa-learn as the wrong user.
Generally speaking, if you're using spamd, root is the wrong user.
sa-learn never scans mail while running as root, so it will never use a
bayes DB in root's homedir.

su yourself to the spamassassin user before performing sa-learn calls.