You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Rainer Dorsch <rd...@web.de> on 2006/12/13 22:39:08 UTC

Bayes doesn't seem to be working for me

Hello,

I installed exim4 and spamassassin following 

http://koivi.com/exim4-config/
Installing and configuring Exim 4 on Debian

Bayes did not work and I read the wiki entry:

http://wiki.apache.org/spamassassin/BayesNotWorking
Bayes doesn't seem to be working for me!


To create the bayes database, I run

/usr/bin/sa-learn --spam ~/Maildir/.Spam-test/cur/
(and other dirs)

Bayesian filtering parts seem to be ok:

rd@alzental-castle:~$ spamassassin -D --lint 2>&1 |grep bayes
debug: config: read file /usr/share/spamassassin/23_bayes.cf
debug: bayes: 18897 tie-ing to DB file R/O /home/rd/.spamassassin/bayes_toks
debug: bayes: 18897 tie-ing to DB file R/O /home/rd/.spamassassin/bayes_seen
debug: bayes: found bayes db version 3
debug: bayes corpus size: nspam = 7812, nham = 8204
debug: bayes token 'H*Ad:D*org' => 0.0936018929062978
debug: bayes: score = 0.30291982757203
debug: bayes: 18897 untie-ing
debug: bayes: 18897 untie-ing db_toks
debug: bayes: 18897 untie-ing db_seen
rd@alzental-castle:~$

Also the database looks ok to me:

rd@alzental-castle:~$ sa-learn --dump magic
0.000          0          3          0  non-token data: bayes db version
0.000          0       7812          0  non-token data: nspam
0.000          0       8204          0  non-token data: nham
0.000          0     143834          0  non-token data: ntokens
0.000          0 1160430967          0  non-token data: oldest atime
0.000          0 1165960464          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal sync 
atime
0.000          0 1166043027          0  non-token data: last expiry atime
0.000          0    5529600          0  non-token data: last expire atime 
delta
0.000          0     586583          0  non-token data: last expire reduction 
count
rd@alzental-castle:~$



My mails get this added to their headers:


 X-SA-Exim-Connect-IP: 217.72.192.221
 X-SA-Exim-Mail-From: users-return-@spamassassin.apache.org
 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on alzental-castle.de
 X-Spam-Level: 
 X-Spam-Status: No, score=0.6 required=5.0 tests=MSGID_FROM_MTA_HEADER,
        NO_REAL_NAME autolearn=no version=3.1.7
 Subject: WELCOME to users@spamassassin.apache.org
 X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
 X-SA-Exim-Scanned: Yes (on alzental-castle.de)


Here I am missing any BAYES_... status field.



I am running spamd with these options:

OPTIONS="--create-prefs --max-children 1 --helper-home-dir"

I am running spamassassin 3.1.7 (I saw the same behaviour in 3.0.3)

It is a Debian sarge platform with either spamassassing from 
backports.org/3.1.7 (or the native version/3.0.3).


Any hint what to check next would be helpful. I am wondering, if spamd is 
looking at the wrong place for the bayes database. Can I check where spamd 
looks for the bayes database (in my case the right location is 
~/.spamassassin/bayes*)

Many thanks,
Rainer

-- 
Rainer Dorsch
Alzentalstr. 28
D-71083 Herrenberg
07032-919495
jabber: rdorsch@jabber.org
GPG Fingerprint: 5966 C54C 2B3C 42CC 1F4F  8F59 E3A8 C538 7519 141E
Full GPG key: http://pgp.mit.edu/

Re: Bayes doesn't seem to be working for me

Posted by Rainer Dorsch <rd...@web.de>.
Markus,

the key was:

sa-learn was run by the user rd, and the bayes database went into the 
directory

~rd/.spamassassin

spamd was called from exim, i.e. it was running under the userid Debian-exim 
and thus *not* checking ~rd/.spamassassin

I am right now the only user on that system, so I added

bayes_path /home/rd/.spamassassin/bayes

to /etc/spamassassin/local.cf

which makes spamd looking at the right place for the bayes database (not this 
is not ONLY the directory, but also the prefix of the files:

rd@alzental-castle:~$ cd ~rd/.spamassassin/
rd@alzental-castle:~/.spamassassin$ ls -1
auto-whitelist
bayes_seen
bayes_toks
bayes_toks.expire20200
user_prefs
user_prefs~
rd@alzental-castle:~/.spamassassin$

)

Hope that helps,
Rainer

Am Donnerstag, 14. Dezember 2006 03:36 schrieben Sie:
> hello,
>
> can you share with me how you solve your problem posted at spamassassin
> mailing list below?
>
> thank you
>
> Best Regards,
> Markus
>
> ----- Original Message ----
> From: Rainer Dorsch <rd...@web.de>
> To: users@spamassassin.apache.org
> Sent: Thursday, 14 December, 2006 6:32:39 AM
> Subject: Re: Bayes doesn't seem to be working for me
>
> Am Mittwoch, 13. Dezember 2006 23:40 schrieb Theo Van Dinter:
> > On Wed, Dec 13, 2006 at 10:39:08PM +0100, Rainer Dorsch wrote:
> > > rd@alzental-castle:~$ spamassassin -D --lint 2>&1 |grep bayes
> > > debug: config: read file /usr/share/spamassassin/23_bayes.cf
> > > debug: bayes: 18897 tie-ing to DB file R/O
> > > /home/rd/.spamassassin/bayes_toks debug: bayes: 18897 tie-ing to DB
> > > file R/O /home/rd/.spamassassin/bayes_seen
> >
> > Ok.  So you're running as user rd, and that's the DB you're using.
> >
> > > rd@alzental-castle:~$ sa-learn --dump magic
> > > 0.000          0       7812          0  non-token data: nspam
> > > 0.000          0       8204          0  non-token data: nham
> >
> > ditto.
> >
> > >  X-SA-Exim-Connect-IP: 217.72.192.221
> > >  X-SA-Exim-Mail-From: users-return-@spamassassin.apache.org
> >
> > So you're running from exim.  Is exim using user rb?  My guess is not.
> >
> > I know nothing about Exim, but my guess is that scanning happens at the
> > MTA point, and not the MDA point.  In that case, you're running
> > site-wide, so no per-user configs or dbs, and you'll want to configure SA
> > to be site-wide (use bayes_path, etc.)
>
> Thanks, that solved my problem.
>
> Rainer

-- 
Rainer Dorsch
Alzentalstr. 28
D-71083 Herrenberg
07032-919495
jabber: rdorsch@jabber.org
GPG Fingerprint: 5966 C54C 2B3C 42CC 1F4F  8F59 E3A8 C538 7519 141E
Full GPG key: http://pgp.mit.edu/

Re: Bayes doesn't seem to be working for me

Posted by Rainer Dorsch <rd...@web.de>.
Am Mittwoch, 13. Dezember 2006 23:40 schrieb Theo Van Dinter:
> On Wed, Dec 13, 2006 at 10:39:08PM +0100, Rainer Dorsch wrote:
> > rd@alzental-castle:~$ spamassassin -D --lint 2>&1 |grep bayes
> > debug: config: read file /usr/share/spamassassin/23_bayes.cf
> > debug: bayes: 18897 tie-ing to DB file R/O
> > /home/rd/.spamassassin/bayes_toks debug: bayes: 18897 tie-ing to DB file
> > R/O /home/rd/.spamassassin/bayes_seen
>
> Ok.  So you're running as user rd, and that's the DB you're using.
>
> > rd@alzental-castle:~$ sa-learn --dump magic
> > 0.000          0       7812          0  non-token data: nspam
> > 0.000          0       8204          0  non-token data: nham
>
> ditto.
>
> >  X-SA-Exim-Connect-IP: 217.72.192.221
> >  X-SA-Exim-Mail-From: users-return-@spamassassin.apache.org
>
> So you're running from exim.  Is exim using user rb?  My guess is not.
>
> I know nothing about Exim, but my guess is that scanning happens at the MTA
> point, and not the MDA point.  In that case, you're running site-wide, so
> no per-user configs or dbs, and you'll want to configure SA to be site-wide
> (use bayes_path, etc.)

Thanks, that solved my problem.

Rainer


-- 
Rainer Dorsch
Alzentalstr. 28
D-71083 Herrenberg
07032-919495
jabber: rdorsch@jabber.org
GPG Fingerprint: 5966 C54C 2B3C 42CC 1F4F  8F59 E3A8 C538 7519 141E
Full GPG key: http://pgp.mit.edu/

Re: Bayes doesn't seem to be working for me

Posted by Theo Van Dinter <fe...@apache.org>.
On Wed, Dec 13, 2006 at 10:39:08PM +0100, Rainer Dorsch wrote:
> rd@alzental-castle:~$ spamassassin -D --lint 2>&1 |grep bayes
> debug: config: read file /usr/share/spamassassin/23_bayes.cf
> debug: bayes: 18897 tie-ing to DB file R/O /home/rd/.spamassassin/bayes_toks
> debug: bayes: 18897 tie-ing to DB file R/O /home/rd/.spamassassin/bayes_seen

Ok.  So you're running as user rd, and that's the DB you're using.

> rd@alzental-castle:~$ sa-learn --dump magic
> 0.000          0       7812          0  non-token data: nspam
> 0.000          0       8204          0  non-token data: nham

ditto.

>  X-SA-Exim-Connect-IP: 217.72.192.221
>  X-SA-Exim-Mail-From: users-return-@spamassassin.apache.org

So you're running from exim.  Is exim using user rb?  My guess is not.

I know nothing about Exim, but my guess is that scanning happens at the MTA
point, and not the MDA point.  In that case, you're running site-wide, so no
per-user configs or dbs, and you'll want to configure SA to be site-wide (use
bayes_path, etc.)

-- 
Randomly Selected Tagline:
"I see!  So the cockpits are going to be filled with drunks with guns ...
 Co-pilot, switch seats with me!  I can't get another DUI!  and if the
 cop gets nosy, plug him!"       - Lewis Black, The Daily Show 2002.07.17