You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Евгений Ширинкин <ev...@mitme.ru> on 2005/05/15 21:08:52 UTC

Don't see BAYES in headers

I'm using SpamAssassin 3.0.3  with amavisd and mysql.
I've learned it for 900 ham messages and 1000 spam messages this way for 
each user:

/usr/local/bin/sa-learn -u igor@domain.ru --ham 
/home/cyrus/spool/domain/domain.ru/user/igor/NoSpam

/usr/local/bin/sa-learn -u igor@domain.ru --spam 
/home/cyrus/spool/domain/domain.ru/user/igor/IsSpam

The problem is that SpamAssassin doesn't use BAYES tests when checking 
messages. i.e. i don't see in message headers BAYES_XX in tests section.

There is my config:
use_dcc 0
use_pyzor 0
use_razor2 0
skip_rbl_checks 1
use_bayes 1
use_bayes_rules 1
bayes_path /usr/local/spamassassin/bayes
report_safe 0
dns_available no
bayes_store_module   Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn   DBI:mysql:spamdb:localhost
bayes_sql_username   postfix
bayes_sql_password   ********
user_scores_dsn DBI:mysql:spamdb:localhost
user_scores_sql_usernamedb      postfix
user_scores_sql_passworddb      ********
bayes_auto_learn 0
bayes_ignore_header X-Virus-Scanned
bayes_ignore_header X-Amavis-Alert
bayes_ignore_header X-Sieve

Maybe I forgot something?

Re: Don't see BAYES in headers

Posted by Евгений Ширинкин <ev...@mitme.ru>.
>
>Which config was all that in? local.cf, or user_prefs?
>  
>
local.cf

>  
>
>>Maybe I forgot something?
>>
>>    
>>
>
>What does sa-learn --dump magic say?
>
>  
>
I understood the problem. Amavisd starts spamassassin with user cyrus. 
I'm learning spamassassin under each user with sa-learn option -u.
I just wanted that each user had it's own spam base. Then I don't 
understand for what purposes option -u is used.
Maybe spamassassin can be started for each user?




Re: Don't see BAYES in headers

Posted by Matt Kettler <mk...@evi-inc.com>.
Евгений Ширинкин wrote:
> Matt Kettler wrote:
> 
>> Евгений Ширинкин wrote:
>>  
>>
>>>>
>>>>
>>>>     
>>>
>>> I understood the problem. Amavisd starts spamassassin with user cyrus.
>>> I'm learning spamassassin under each user with sa-learn option -u.
>>> I just wanted that each user had it's own spam base. Then I don't
>>> understand for what purposes option -u is used.
>>>   
>>
>>
>> -u should work for that, but only if you're using a virtual
>> configuration such
>> as SQL.
>>
>> One thing that's a bit confusing is your local.cf has a bayes_path
>> statement in
>> it, but also SQL statements.
>>
>> try running sa-learn with debugging enabled (-D):
>>
>> sa-learn --dump magic -D   
>>
>> And see if SA is correctly using SQL or not. If it's not using SQL,
>> then the -u
>> will be unused.
>>
>>  
>>
> I've tried that:
> 
> /usr/local/bin/sa-learn -u evgeny@domain.ru --dump magic -D --spam
> /home/cyrus/spool/domain/domain.ru/user/evgeny/IsSpam
> 
> 
> the result is:
> bla-bla-bla....
> debug: bayes: Using username: evgeny@domain.ru
> debug: bayes: Database connection established
> debug: bayes: found bayes db version 3
> debug: bayes: Using userid: 3
> debug: Score set 2 chosen.
> 0.000          0          3          0  non-token data: bayes db version
> 0.000          0       1046          0  non-token data: nspam
> 0.000          0       1020          0  non-token data: nham
> 0.000          0     147652          0  non-token data: ntokens
> 0.000          0 1104925714          0  non-token data: oldest atime
> 0.000          0 1116239222          0  non-token data: newest atime
> 0.000          0          0          0  non-token data: last journal
> sync atime
> 0.000          0 1115971232          0  non-token data: last expiry atime
> 0.000          0   11059200          0  non-token data: last expire
> atime delta
> 0.000          0      26201          0  non-token data: last expire
> reduction count
> 
> It seems that sa-learn connects to MySQL. There are a lot of records in
> table bayes_vars. But SpamAssassin connects to MySQL and uses only
> records for user cyrus.
> How should I deal with that?

At this point, it's more of an amavisd question.

It's not up to spamassassin to decide what user's bayes DB to access.
SpamAssassin does not EVER, under any condition, read the To: header to figure
out who's bayes DB to use. It's entirely up to the tool calling spamassassin to
specify this.


Amavisd may not even support anything but one user. At which point, you'll have
to pass -u cyrus to your training and be done with it.



Re: Don't see BAYES in headers

Posted by Евгений Ширинкин <ev...@mitme.ru>.
Matt Kettler wrote:

>Евгений Ширинкин wrote:
>  
>
>>> 
>>>
>>>      
>>>
>>I understood the problem. Amavisd starts spamassassin with user cyrus.
>>I'm learning spamassassin under each user with sa-learn option -u.
>>I just wanted that each user had it's own spam base. Then I don't
>>understand for what purposes option -u is used.
>>    
>>
>
>-u should work for that, but only if you're using a virtual configuration such
>as SQL.
>
>One thing that's a bit confusing is your local.cf has a bayes_path statement in
>it, but also SQL statements.
>
>try running sa-learn with debugging enabled (-D):
>
>sa-learn --dump magic -D	
>
>And see if SA is correctly using SQL or not. If it's not using SQL, then the -u
>will be unused.
>
>  
>
I've tried that:

/usr/local/bin/sa-learn -u evgeny@domain.ru --dump magic -D --spam 
/home/cyrus/spool/domain/domain.ru/user/evgeny/IsSpam


the result is:
bla-bla-bla....
debug: bayes: Using username: evgeny@domain.ru
debug: bayes: Database connection established
debug: bayes: found bayes db version 3
debug: bayes: Using userid: 3
debug: Score set 2 chosen.
0.000          0          3          0  non-token data: bayes db version
0.000          0       1046          0  non-token data: nspam
0.000          0       1020          0  non-token data: nham
0.000          0     147652          0  non-token data: ntokens
0.000          0 1104925714          0  non-token data: oldest atime
0.000          0 1116239222          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal 
sync atime
0.000          0 1115971232          0  non-token data: last expiry atime
0.000          0   11059200          0  non-token data: last expire 
atime delta
0.000          0      26201          0  non-token data: last expire 
reduction count

It seems that sa-learn connects to MySQL. There are a lot of records in 
table bayes_vars. But SpamAssassin connects to MySQL and uses only 
records for user cyrus.
How should I deal with that?


Re: Don't see BAYES in headers

Posted by Matt Kettler <mk...@evi-inc.com>.
Евгений Ширинкин wrote:
>
>>  
>>
> I understood the problem. Amavisd starts spamassassin with user cyrus.
> I'm learning spamassassin under each user with sa-learn option -u.
> I just wanted that each user had it's own spam base. Then I don't
> understand for what purposes option -u is used.

-u should work for that, but only if you're using a virtual configuration such
as SQL.

One thing that's a bit confusing is your local.cf has a bayes_path statement in
it, but also SQL statements.

try running sa-learn with debugging enabled (-D):

sa-learn --dump magic -D	

And see if SA is correctly using SQL or not. If it's not using SQL, then the -u
will be unused.


Re: Don't see BAYES in headers

Posted by Евгений Ширинкин <ev...@mitme.ru>.
>
>Which config was all that in? local.cf, or user_prefs?
>  
>
local.cf

>  
>
>>Maybe I forgot something?
>>
>>    
>>
>
>What does sa-learn --dump magic say?
>
>  
>
I understood the problem. Amavisd starts spamassassin with user cyrus.
I'm learning spamassassin under each user with sa-learn option -u.
I just wanted that each user had it's own spam base. Then I don't
understand for what purposes option -u is used.
Maybe spamassassin can be started for each user?





Re: Don't see BAYES in headers

Posted by Matt Kettler <mk...@evi-inc.com>.
Евгений Ширинкин wrote:
> I'm using SpamAssassin 3.0.3  with amavisd and mysql.
> I've learned it for 900 ham messages and 1000 spam messages this way for
> each user:
> 
> /usr/local/bin/sa-learn -u igor@domain.ru --ham
> /home/cyrus/spool/domain/domain.ru/user/igor/NoSpam
> 
> /usr/local/bin/sa-learn -u igor@domain.ru --spam
> /home/cyrus/spool/domain/domain.ru/user/igor/IsSpam
> 
> The problem is that SpamAssassin doesn't use BAYES tests when checking
> messages. i.e. i don't see in message headers BAYES_XX in tests section.
> 
> There is my config:

<snip>

Which config was all that in? local.cf, or user_prefs?

> 
> Maybe I forgot something?
> 

What does sa-learn --dump magic say?