In postfix, I'm calling spamassassin with the 2 lines: smtp inet n - n - - smtpd -o content_filter=spamassassin spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
In /etc/cron.d/sa-learn I have: 51 * * * * spamd sa-learn --spam /var/log/spamassassin/SPAM/ >/dev/null 2>&1 52 * * * * spamd sa-learn --ham /var/log/spamassassin/HAM/ >/dev/null 2>&1 (/var/log/spamassassin is spamd's home directory, and it's where the SPAM/HAM is getting copied for learning) My /etc/mail/spamassassin/local.cf file is: required_hits 5 report_safe 0 rewrite_header Subject [SPAM] required_score 5.0 use_bayes 1 use_bayes_rules 1 bayes_auto_learn 0 bayes_path /var/log/spamassassin/.spamassassin/bayes Would the above config make spamassassin run as the spamd user? (It's CentOS 6.5) I've verified the Bayes database is good and populated for user spamd. Thanks, Nick -----Original Message----- From: Bowie Bailey [mailto:bowie_bai...@buc.com] Sent: Wednesday, October 08, 2014 11:35 AM To: users@spamassassin.apache.org Subject: Re: spamassassin working very poorly On 10/8/2014 11:15 AM, Nick wrote: > I seem to be catching a lot more SPAM, but no matter what I try, it seems > Bayes isn't getting utilized. I have ~700 SPAMS and 2400 HAMS. When I run > "spamassassin -D --lint" (as the same user Postfix is running spamc as), it > comes back with a report that seems to utilize Bayes, but when normal e-mail > flows through, I don't see any indication of Bayes in the headers. Also, when > I run "sa-learn --dump magic" (as user spamd), I can see that nspam and nham > are correct. I've also tried setting bayes_path, but still no Bayes in the > headers. Any idea what could be wrong? Here is a most recent header: > > http://pastebin.com/J6TbrVG8 (had to use pastebin as the mailing list > was rejecting me!) So... 1) The Bayes DB for spamd has enough ham and spam to be used 2) Incoming email does not get a Bayes result This means that the SA process scanning your mail is NOT using the same database you are querying. The most common cause of this is running sa-learn as the wrong user. Are you 100% sure spamd is running as the spamd user? It may also be possible for config options or run-time flags to affect which database is being used. Double-check your config and the options you are passing to spamd. -- Bowie