You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Stephane MAGAND <st...@gmail.com> on 2010/03/05 15:45:54 UTC

Spamassassin with Bayes/MySQL

Hi

i have a small problems for connect Spamassassin 3.3.0 to my sql server:

my local.cf:

use_bayes 1
bayes_auto_expire 0
bayes_auto_learn                        1
bayes_auto_learn_threshold_nonspam      0.1
bayes_auto_learn_threshold_spam         9.0
bayes_store_module      Mail::SpamAssassin::BayesStore::MySQL
bayes_sql_dsn   DBI:mysql:MyDatabase:localhost
bayes_sql_username      MyLogin
bayes_sql_password      MyPassword



But i think's that he don't use the good login/pass:

mars  5 14:56:25.653 [13260] dbg: bayes: learner_new
self=Mail::SpamAssassin::Plugin::Bayes=HASH(0xa211dd0),
bayes_store_module=Mail::SpamAssassin::BayesStore::MySQL
mars  5 14:56:25.675 [13260] dbg: bayes: using username: root
mars  5 14:56:25.675 [13260] dbg: bayes: learner_new: got
store=Mail::SpamAssassin::BayesStore::MySQL=HASH(0xb030fc0)
mars  5 14:56:25.675 [13260] dbg: plugin:
Mail::SpamAssassin::Plugin::Bayes=HASH(0xa211dd0) implements
'learner_is_scan_available', priority 0
mars  5 14:56:25.696 [13260] dbg: bayes: database connection established
mars  5 14:56:25.697 [13260] dbg: bayes: found bayes db version 3
mars  5 14:56:25.697 [13260] dbg: bayes: unable to initialize database
for root user, aborting!
mars  5 14:56:25.698 [13260] dbg: config: score set 0 chosen.
mars  5 14:56:25.698 [13260] dbg: message: main message type: text/plain
mars  5 14:56:25.699 [13260] dbg: message: ---- MIME PARSER START ----
mars  5 14:56:25.699 [13260] dbg: message: parsing normal part
mars  5 14:56:25.699 [13260] dbg: message: ---- MIME PARSER END ----
mars  5 14:56:25.699 [13260] dbg: plugin:
Mail::SpamAssassin::Plugin::DNSEval=HASH(0xac92c58) implements
'check_start', priority 0
mars  5 14:56:25.703 [13260] dbg: bayes: database connection established
mars  5 14:56:25.703 [13260] dbg: bayes: found bayes db version 3
mars  5 14:56:25.703 [13260] dbg: bayes: unable to initialize database
for root user, aborting!


he said "bayes: using username: root"

Anyone know why ?

thanks for your help

Re: Spamassassin with Bayes/MySQL

Posted by Jari Fredriksson <ja...@iki.fi>.
On 5.3.2010 17:23, Stephane MAGAND wrote:
> Hi
> 
> ok i have put
> bayes_sql_override_username
> 
> and now that's work thanks ;=)
> 
> Another small question, after bayes, can i put AWL in MySQL ?
> 

Yes you can, it's all in the doku or wiki. Anyway:

--- local.cf ----------

# Enable awl
auto_whitelist_factory  Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn            DBI:mysql:spamassassin:dbsrv
user_awl_sql_username   spamassassin
user_awl_sql_password   amazing

-- database ---------

 CREATE TABLE `awl` (
  `username` varchar(100) NOT NULL DEFAULT '',
  `email` varchar(200) NOT NULL DEFAULT '',
  `ip` varchar(40) NOT NULL,
  `count` int(11) DEFAULT '0',
  `totscore` float DEFAULT '0',
  `lastupdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
  `signedby` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`username`,`email`,`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;

-- 
http://www.iki.fi/jarif/



Re: Spamassassin with Bayes/MySQL

Posted by Stephane MAGAND <st...@gmail.com>.
Hi

ok i have put
bayes_sql_override_username

and now that's work thanks ;=)

Another small question, after bayes, can i put AWL in MySQL ?

bye
stephane




2010/3/5 David Morton <mo...@dgrmm.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Stephane MAGAND wrote:
>
>> mars  5 14:56:25.675 [13260] dbg: bayes: using username: root
>
> This is not the mysql authentication username, this is talking about the
> system username used to submit the request, and stored along with the
> bayes tokens.
>
>> mars  5 14:56:25.697 [13260] dbg: bayes: found bayes db version 3
>
> It wouldn't be able to say this if it didn't log into the database
> correctly.
>
> If you want to force the stored username to be something other than
> "root", you can use
>
> bayes_sql_override_username
>
> see: http://spamassassin.apache.org/full/3.0.x/dist/sql/README.bayes
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkuRHW8ACgkQUy30ODPkzl1JqACfS2WGZ31vIPYrPAcpnpm+dvwp
> qgAAnj+I4TnNouLwjyJeiufWSfRXd57R
> =XB9o
> -----END PGP SIGNATURE-----
>

Re: Spamassassin with Bayes/MySQL

Posted by David Morton <mo...@dgrmm.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephane MAGAND wrote:

> mars  5 14:56:25.675 [13260] dbg: bayes: using username: root

This is not the mysql authentication username, this is talking about the
system username used to submit the request, and stored along with the
bayes tokens.

> mars  5 14:56:25.697 [13260] dbg: bayes: found bayes db version 3

It wouldn't be able to say this if it didn't log into the database
correctly.

If you want to force the stored username to be something other than
"root", you can use

bayes_sql_override_username

see: http://spamassassin.apache.org/full/3.0.x/dist/sql/README.bayes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuRHW8ACgkQUy30ODPkzl1JqACfS2WGZ31vIPYrPAcpnpm+dvwp
qgAAnj+I4TnNouLwjyJeiufWSfRXd57R
=XB9o
-----END PGP SIGNATURE-----

Re: Spamassassin with Bayes/MySQL

Posted by RW <rw...@googlemail.com>.
On Fri, 5 Mar 2010 15:45:54 +0100
Stephane MAGAND <st...@gmail.com> wrote:

> Hi
> 
> i have a small problems for connect Spamassassin 3.3.0 to my sql
> server:
> 
> my local.cf:
> 
> use_bayes 1
> bayes_auto_expire 0
> bayes_auto_learn                        1
> bayes_auto_learn_threshold_nonspam      0.1
> bayes_auto_learn_threshold_spam         9.0
> bayes_store_module      Mail::SpamAssassin::BayesStore::MySQL
> bayes_sql_dsn   DBI:mysql:MyDatabase:localhost
> bayes_sql_username      MyLogin
> bayes_sql_password      MyPassword
> 
> ...

> he said "bayes: using username: root"

I don't use sql for Bayes, but I presume that bayes_sql_username is
an sql user of the database (used to authenticate to the sql backend),
whereas "bayes: using username: root" is referring to the mail user -
either a unix account or a mail virtual user.