I am working an a program that accepts spamassassin 'TELL' (learning)
reports (see the new 'spamassassin coach' for outlook and thunderbird)

Sa coach sends stream to spamd with 'TELL' protocol.
It then calls the equivalent of 'spamassassin -r' (for spam) or '-z for
ham' or -f for forget.

Do I need to call sa-learn --ham and sa-learn --spam also?

If I call sa-learn --ham or --spam INSTEAD OF, I lose the ability to
report to DCC,razor,spamcop.,pyzor, etc.

So, is spamassassin -r a superset of sa-learn --spam? Or do I need to
run them both to get the local Bayesian table updated?

It looks like spamassassin -r touches the Bayesian files, but doesn't
update them:
(Thanks to Gary V for looking at this for me)

Also, my program does change user to amavis (reported via top, and
ps-aux, and verified by ownership of files it creates, but it still
tries to use /root/.spamassassin/user_prefs (which it can't create as
user amavis! And I needed to start program as root to use port 783, I
use spamassassin -xr and it doesn't try to create /root/.spamassassin)


sfa:~# ls -l /var/lib/amavis/.spamassassin/
total 40
-rwxr-x---  1 amavis amavis 12288 2006-08-19 20:51 auto-whitelist
-rw-rw-rw-  1 amavis amavis    12 2006-08-27 12:18 bayes.mutex
-rw-------  1 amavis amavis 12288 2006-08-26 18:18 bayes_seen
-rw-------  1 amavis amavis 12288 2006-08-27 12:18 bayes_toks
-rwxr-x---  1 amavis amavis  1487 2006-08-19 20:51 user_prefs

sfa:~# su amavis -c 'spamassassin -r < email.txt'
[2762] warn: reporter: SpamCop message older than 2 days, not reporting
1 message(s) examined.

sfa:~# ls -l /var/lib/amavis/.spamassassin/
total 40
-rwxr-x---  1 amavis amavis 12288 2006-08-19 20:51 auto-whitelist
-rw-rw-rw-  1 amavis amavis    12 2006-09-03 10:52 bayes.mutex
-rw-------  1 amavis amavis 12288 2006-09-03 10:51 bayes_seen
-rw-------  1 amavis amavis 12288 2006-09-03 10:51 bayes_toks
-rwxr-x---  1 amavis amavis  1487 2006-08-19 20:51 user_prefs

sfa:~# su amavis -c 'sa-learn --spam < email.txt'
Learned tokens from 1 message(s) (1 message(s) examined)

sfa:~# ls -l /var/lib/amavis/.spamassassin/
total 52
-rwxr-x---  1 amavis amavis 12288 2006-08-19 20:51 auto-whitelist
-rw-rw-rw-  1 amavis amavis    15 2006-09-03 10:53 bayes.mutex
-rw-------  1 amavis amavis 12288 2006-09-03 10:53 bayes_seen
-rw-------  1 amavis amavis 24576 2006-09-03 10:53 bayes_toks
-rwxr-x---  1 amavis amavis  1487 2006-08-19 20:51 user_prefs

Looks like spamassassin -r is needed to report spam, but sa-learn --spam
is needed to train the baysian filters?


-- 
Michael Scheidell, CTO
SECNAP Network Security
561-999-5000 x 1131
www.secnap.com

Reply via email to