LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-03-2009, 07:12 PM   #1
fredgc
LQ Newbie
 
Registered: Aug 2008
Location: Seattle
Posts: 4

Rep: Reputation: 0
SpamAssassin is not reporting any Bayes score


I have a gentoo computer I am using as the household firewall, mail server, etc. It is running Amavis-new with SpamAssissin.

SpamAssissin is filtering spam. The built in rules are being reported and my local rules are also working.

The problem is that no messages get a Bayes score, neither positive nor negative. Can anybody recommend ways to debug this?

The log file shows it is accessing the database:
Code:
jeeves ~ # grep -i bayes /var/log/mail | tail
May  3 12:17:06 jeeves amavis[22342]: (22342-18) SA dbg: locker: safe_lock: created /home/spamtrap/.spamassassin/bayes\.lock.jeeves.gchouse.org.22342
May  3 12:17:06 jeeves amavis[22342]: (22342-18) SA dbg: locker:safe_lock: trying to get lock on /home/spamtrap/.spam\assassin/bayes with 0 retries
May  3 12:17:06 jeeves amavis[22342]: (22342-18) SA dbg: locker:safe_lock: link to /home/spamtrap/.spamassassin/bayes\.lock: link ok
May  3 12:17:06 jeeves amavis[22342]: (22342-18) SA dbg: bayes: tie-ing to DB file R/W /home/spamtrap/.spamassassin/bayes_toks
May  3 12:17:07 jeeves amavis[22342]: (22342-18) SA dbg: bayes: tie-ing to DB file R/W /home/spamtrap/.spamassassin/bayes_seen
May  3 12:17:08 jeeves amavis[22342]: (22342-18) SA dbg: bayes: found bayes db version 3
May  3 12:17:13 jeeves amavis[22342]: (22342-18) SA dbg: bayes: learned '28345cc8de2fbaacc7baee1447b61e27ed2c3514@sa_generated', atime: 1241378209
May  3 12:17:13 jeeves amavis[22342]: (22342-18) SA dbg: bayes: untie-ing
May  3 12:17:14 jeeves amavis[22342]: (22342-18) SA dbg: bayes: files locked, now unlocking lock
May  3 12:17:14 jeeves amavis[22342]: (22342-18) SA dbg: locker: safe_unlock: unlink /home/spamtrap/.spamassassin/bayes.lock
The database does look like its growing:

Code:
jeeves ~ # sudo -H -u spamtrap sa-learn --dump magic
0.000          0          3          0  non-token data: bayes db version
0.000          0        792          0  non-token data: nspam
0.000          0       2255          0  non-token data: nham
0.000          0     137433          0  non-token data: ntokens
0.000          0 1234689516          0  non-token data: oldest atime
0.000          0 1241378209          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal sync atime
0.000          0 1240218428          0  non-token data: last expiry atime
0.000          0    5529600          0  non-token data: last expire atime delta
0.000          0      51402          0  non-token data: last expire reduction count
And finally, amavisd is running as user spamtrap:
Code:
jeeves ~ # ps auxw | grep amavis
spamtrap   533  0.1 18.6  62848 23508 ?        S    12:56   0:14 amavisd (ch8-avail)
spamtrap   952  0.1 20.1  62276 25420 ?        S    13:28   0:13 amavisd (ch6-avail)
root      3520  0.0  0.4   1760   596 pts/0    S+   16:48   0:00 grep --colour=auto amavis
spamtrap 22327  0.0  1.6  60948  2052 ?        Ss   02:06   0:14 amavisd (master)

What did I forget?
 
Old 05-04-2009, 02:38 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Try adding this to your local.cf

use_bayes 1
bayes_auto_learn 1
add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_

See if that looks a bit more interesting.

Last edited by rweaver; 05-04-2009 at 02:39 PM.
 
Old 05-05-2009, 12:14 AM   #3
fredgc
LQ Newbie
 
Registered: Aug 2008
Location: Seattle
Posts: 4

Original Poster
Rep: Reputation: 0
I already had
use_bayes 1
bayes_auto_learn 1
So I am adding the third line. Now I guess I wait for some mail and look at the logs...
 
Old 06-08-2009, 01:04 PM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
What happened? -- Any improvement?
 
Old 06-10-2009, 12:05 AM   #5
fredgc
LQ Newbie
 
Registered: Aug 2008
Location: Seattle
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you for asking!

I'm still not seeing anything in /var/log/mail except what I had above about connecting to the database. I suspect that I shouldn't?

However, I now see some messages with BAYES_00=-2.599, and a few with BAYES_20. I think that means it is working at finding ham (it was correct -- the email was indeed ham). But I'm not seeing anything in my junk folder marked with BAYES. Could my database be bad?

There are some messages in the junk folder. These are all messages that matched home-grown rules for forged headers.

Any advice?
 
Old 06-10-2009, 12:34 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
A couple of points

First, if you are using amavisd, add_headers will have no effect, since amavisd adds headers, not spamassassin.

Second, I suspect that header checks are taking place before content filtering, and hence not being sent to amavisd.

Try sending yourself a test spam message that won't get caught by your header checks and look at the headers. See http://spamassassin.apache.org/gtube/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Amavis, SpamAssassin and Shared Bayes Files juergen Linux - Server 0 09-25-2007 08:34 AM
Howto get spam to train bayes hendrixbart Linux - Software 4 07-26-2007 07:50 PM
spamassassin bayes Red Squirrel Linux - Software 3 12-26-2006 12:54 PM
Bayes Problem kemplej Linux - Software 1 06-16-2004 06:03 PM
What license should SCORE use? flamesrock Linux - Software 2 02-08-2004 09:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration