bayes on MySQL problem

Kosta Lekas KLekas at foxriver.com
Fri Mar 24 21:34:10 GMT 2006


That worked, thanks.

Kosta Lekas
Fox River Financial Resources
630.482.7142 - office
630.885.9355 - mobile
630.232.6074 - fax

-----Original Message-----
From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Matt
Kettler
Sent: Friday, March 24, 2006 3:19 PM
To: MailScanner discussion
Subject: Re: bayes on MySQL problem

Kosta Lekas wrote:
> I moved my local bayes to a remote mysql. When I lint the rule set as
> root on my MS gateway everything is good (output below):
> 
> spamassassin -D -p /etc/MailScanner/spam.assassin.prefs.conf --lint

What version of MailScanner are you on? You shouldn't need to pass -p to
spamassassin anymore. There should be a
/etc/mail/spamassassin/mailscanner.cf
which is a symlink to spam.assassin.prefs.conf.


> 
> [11229] dbg: bayes: using username: root
> 
> [11229] dbg: bayes: database connection established
> 
> [11229] dbg: bayes: found bayes db version 3
> 
> [11229] dbg: bayes: Using userid: 1
> 
> [11229] dbg: bayes: corpus size: nspam = 2042, nham = 1857
> 
> [11229] dbg: bayes: tok_get_all: token count: 20
> 
> [11229] dbg: bayes: cannot use bayes on this message; not enough
usable
> tokens found
> 
> [11229] dbg: bayes: not scoring message, returning undef
> 
>  
> 
>  
> 
> But with MailScanner debug on I see problems when running as postfix:
> 
> [11285] dbg: bayes: database connection established
> 
> [11285] dbg: bayes: found bayes db version 3
> 
> [11285] dbg: bayes: unable to initialize database for postfix user,
> aborting!
> 
> [11285] dbg: bayes: not scoring message, returning undef
> 
> [11285] dbg: bayes: opportunistic call attempt failed, DB not readable
> 
>  
> 
> I followed the wiki
> http://www.sng.ecs.soton.ac.uk/mailscanner/serve/cache/390.html
> 
>  
> 
> I have set in my spam.assassin .prefs.conf:
> 
> bayes_store_module      Mail::SpamAssassin::BayesStore::SQL
> bayes_sql_dsn           DBI:mysql:*sa_bayes:remoteMysqlBox*
> bayes_sql_username      *sa_user*
> bayes_sql_password      *sa_password*
> 


>  
> 
> Can someone please tell me what I am doing wrong.

You're using two different users.

To spamassassin, bayes databases are stored in SQL with a different
table
per-user that EXECUTES spamassassin.

In your one test, you're running as root, thus it's going to look in
root's
table. In the other test, you're running as postfix, so it is going to
look in
the table for the postfix user.

I would suggest adding:
bayes_sql_override_username 	root

To your config. Note that "bayes_sql_username" sets the username that SA
authenticates to bayes with. This option sets what email "username" SA
is going
to be using, thus which table it will use.

-- 
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner

Before posting, read http://wiki.mailscanner.info/posting

Support MailScanner development - buy the book off the website! 


More information about the MailScanner mailing list