You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Mitchell Hudson <mi...@frontgatesolutions.com> on 2008/03/18 23:59:33 UTC

Bayes not running but no errors

Hello there,

I've been trying to get my bayesian filter working for a while now and 
haven't had any success so I was hoping someone might be able to point 
me in the right direction.

Simply it's not scoring, it leanrs, but doesn't put a score on any mail. 
It has more than enough tokens learned, it's accessing the database, 
none of the settings I can see are blocking it. Spamassassin itself is 
running great actually I have spamassassin sans bayes running pretty 
well, we just get a lot of spam so my users get irritated like users do. 
So I'm kindof stuck. Here's the general breakdown:

#spamassassin -D --lint
[23822] dbg: bayes: using username: spamassassin
[23822] dbg: bayes: database connection established
[23822] dbg: bayes: found bayes db version 3
[23822] dbg: bayes: Using userid: 1

Which is all that one says about bayes, nothing else.


#sa-learn -D --ham message
...
[24248] dbg: bayes: using username: spamassassin
[24248] dbg: bayes: database connection established
[24248] dbg: bayes: found bayes db version 3
[24248] dbg: bayes: Using userid: 1
[24248] dbg: config: score set 3 chosen.
[24248] dbg: learn: initializing learner
[24248] dbg: bayes: bayes journal sync starting
[24248] dbg: bayes: bayes journal sync completed
[24248] dbg: bayes: expiry starting
[24248] dbg: bayes: expiry completed
...
[24248] dbg: bayes: seen 
(d0679557f4e426da7911055b03e9101bcb514994@sa_generated) put
[24248] dbg: bayes: learned 
'd0679557f4e426da7911055b03e9101bcb514994@sa_generated', atime: 1200549600


I added some bayes headers and pulled those from an e-mail header:
X-Spam-Bayes-Token-Summary: Bayes not run.

#From local.cf:
use_bayes                     1
use_bayes_rules               1
bayes_auto_learn              1
bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn                 
DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
bayes_sql_username            spamassassin
bayes_sql_password            ***
bayes_min_ham_num             100
bayes_min_spam_num            100
bayes_learn_during_report     1
bayes_expiry_max_db_size      180000
bayes_auto_expire             0
bayes_journal_max_size        102400
bayes_learn_to_journal        0
bayes_use_hapaxes             1
bayes_sql_override_username  spamassassin

mysql -u spamassassin -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2368170


# sa-learn --dump all | grep token
0.000          0          3          0  non-token data: bayes db version
0.000          0     197643          0  non-token data: nspam
0.000          0      64097          0  non-token data: nham
0.000          0     233210          0  non-token data: ntokens
0.000          0 1200549600          0  non-token data: oldest atime
0.000          0 1205881213          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal 
sync atime
0.000          0 1205859633          0  non-token data: last expiry atime
0.000          0      43200          0  non-token data: last expire 
atime delta
0.000          0     125089          0  non-token data: last expire 
reduction count

And because I know someone is itching to ask :)   :
# spamassassin -V
SpamAssassin version 3.2.0
  running on Perl version 5.8.8

Any help at all is appreciated.

-- 
--
Mitch



Re: Bayes not running but no errors

Posted by Jari Fredriksson <ja...@iki.fi>.
> Mitchell Hudson schrieb am 18.03.2008 23:59:
> 
>> #From local.cf:
>> bayes_sql_override_username  spamassassin
> 
> You are NOT using bayes_sql_override_username <username>,
> that means you are using a per-user bayes filter. You
> probably call spamc with -u <username>, so every
> <username> has its own set of tokens learned. Each user
> has to fulfill individually the minimum ham/spam mails
> learned.  

I my eyes he IS using bayes_sql_override_username





Re: Bayes not running but no errors

Posted by Mitchell Hudson <mi...@frontgatesolutions.com>.

Alex Woick wrote:
> Mitchell Hudson schrieb am 19.03.2008 18:18:
>
>> I have a few questions though, you said I am not using 
>> bayes_sql_override_username  but I have "bayes_sql_override_username  
>> spamassassin " in my config, does that not count?
> I'm sorry, I overlooked that. Yes, in the configuration that you 
> posted it was set. And I also told rubbish by claiming that you ran 
> under the username root. SA reported the internal userid from the sql 
> table, and that was probably the user 'spamassassin'.
heh, not a problem just wanted to make sure I wasn't missing something.
>
>> As well I tried setting the min_ham and min_spam to 1 just for a 
>> short test, and took out the bayes_sql_override_username  and it 
>> wasn't calling. When I did the use spamassassin; select * from 
>> bayes_vars; I did get a list of people, but they have very few 
>> tokens, in the order of 1 or 2 which looks to me like those tokens 
>> were created when I was tinkering and removed the 
>> sql_override_username, otherwise everything is put into the 
>> spamassassin user which has a few hundred thousand tokens in it 
>> currently.
>
> Yes, that's a valid explanation. Sorry for the confusion from my part. 
> But that leads us back to your question: "why it is not scoring?". Did 
> you really found all bayes-related output from --lint? If I run a 
> "spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related 
> output:
>
> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from @INC
> [21631] dbg: config: fixed relative path: 
> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
> [21631] dbg: config: using 
> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf" 
> for included file
> [21631] dbg: config: read file 
> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
> [21631] dbg: bayes: using username: mail
> [21631] dbg: bayes: database connection established
> [21631] dbg: bayes: found bayes db version 3
> [21631] dbg: bayes: Using userid: 2
> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
> [21631] dbg: bayes: tok_get_all: token count: 21
> [21631] dbg: bayes: score = 0.0020110638266459
> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size: 
> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last 
> expire: 1205444421, Current time: 1205950517
> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
> [21631] dbg: check: 
> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS 
>
>
> I am using Mysql as database.
>
> Tschau
> Alex
Unfortunately that is really all the output which is why it's confusing, 
for everything I can find it should be working:

# spamassassin --lint -D 2>&1|grep -i bayes
[29262] dbg: config: read file 
/hsphere/local/config/mail/spamassassin/23_bayes.cf
[29262] dbg: config: read file 
/hsphere/local/config/mail/spamassassin/70_sare_bayes_poison_nxm.cf
[29262] dbg: config: fixed relative path: 
/hsphere/local/config/mail/spamassassin/sa-update/3.002000/updates_spamassassin_org/23_bayes.cf
[29262] dbg: config: using 
"/hsphere/local/config/mail/spamassassin/sa-update/3.002000/updates_spamassassin_org/23_bayes.cf" 
for included file
[29262] dbg: config: read file 
/hsphere/local/config/mail/spamassassin/sa-update/3.002000/updates_spamassassin_org/23_bayes.cf
[29262] dbg: bayes: using username: spamassassin
[29262] dbg: bayes: database connection established
[29262] dbg: bayes: found bayes db version 3
[29262] dbg: bayes: Using userid: 1




-- 
--
Mitchell Hudson
Systems Administrator
Front Gate Solutions
1711 S Congress Ave
Austin, TX 78704
P: 512-674-9337
C: 512-587-0918
F: 512-499-0440
Mitchell@FrontGateSolutions.com



Re: Bayes not running but no errors

Posted by John Hardin <jh...@impsec.org>.
On Thu, 20 Mar 2008, Mitchell Hudson wrote:

> I'm sorry I should have responded to you directly, I did try both, but 
> encountered the same problem. It'll connect to the database and 
> learn/store tokens, just won't compare against them.

Have you tried running a database trace utility to verify (1) that it is 
indeed connecting to the database at scan time, and (2) exactly what 
queries it is running, to see how it is connecting and what data it is 
retrieving? Granted you probably aren't familiar with the internals of 
bayes DB structure, but something like "it's not connecting as the right 
user" or "it's not querying the bayes tables" should be pretty apparent.

-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Win95: Where do you want to go today?
   Vista: Where will Microsoft allow you to go today?
-----------------------------------------------------------------------
  66 days until the Mars Phoenix lander arrives at Mars

Re: Bayes not running but no errors

Posted by Mitchell Hudson <mi...@frontgatesolutions.com>.
I'm sorry I should have responded to you directly, I did try both, but 
encountered the same problem. It'll connect to the database and 
learn/store tokens, just won't compare against them.

Thanks again!

--Mitch

LEVEAU Stanislas wrote:
> i think in your local.cf it s not 
> Mail::SpamAssassin::BayesStore::*SQL * but 
> Mail::SpamAssassin::BayesStore::*MySQL*
> tries this
>
> Mitchell Hudson a écrit :
>> Hmm... I was checking around and I found a bug with apache that might 
>> be related, but wanted to run it by here first:
>> The bug is here: 
>> https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5728
>> and is related to spamd using -u in conjunction with -q and/or -Q
>>
>> I'm calling spamd with this command:
>> /usr/bin/perl -T -w /hsphere/shared/bin/spamd --max-children=5 
>> --max-conn-per-child=5 --nouser-config --sql-config 
>> --username=vpopmail --socketpath=/var/hsphere/mail/spamd 
>> --socketowner=vpopmail --socketgroup=vchkpw --socketmode=770 
>> --syslog-socket=none
>>
>> If that changes anything...
>>
>> spamc -u rachel@academicintl.com -q 32184 -Q 100000
>>
>> Mitchell Hudson wrote:
>>> I tried both just to be sure, but neither changed the messages when 
>>> I did a --lint.
>>>
>>> I noticed your dsn line was different than mine, so I tried changing 
>>> it to localhost from :bayes_sql_dsn                 
>>> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>>> But then it just didn't connect to the database at all. I went 
>>> through and made sure I had the perl modules installed, and I did 
>>> install Mail::SpamAssassin::BayesStore::MySQL, but I already had 
>>> Mail::SpamAssassin::BayesStore::SQL installed.
>>>
>>> It seems to be connecting to the database great, it learns and I 
>>> have a ton of tokens. But it's not pulling anything back out of the 
>>> database ever. I grepped back through all of my sys logs to see if 
>>> anything reported during all this testing but nothing showed up.
>>>
>>> As always, thanks
>>>
>>> Leveau Stanislas wrote:
>>>>
>>>> My conf for an old mysql version
>>>>
>>>> bayes_store_module              Mail::SpamAssassin::BayesStore::*SQL*
>>>> bayes_sql_dsn                   DBI:mysql:spam:localhost
>>>>
>>>> for a recent mysql version
>>>>
>>>> bayes_store_module              Mail::SpamAssassin::BayesStore::*MySQL*
>>>> bayes_sql_dsn                   DBI:mysql:spam:localhost
>>>>
>>>>
>>>> > Sure, I'll repaste the bayes portion, and include the rest of the 
>>>> file
>>>> > for good measure. Thanks again!
>>>> >
>>>> > # SpamAssassin config file for version 3.2x
>>>> > # Loading SpamAssassin User Preferences From An SQL Database
>>>> > user_scores_dsn
>>>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>>>> > user_scores_sql_username      spamassassin
>>>> > user_scores_sql_password      ***
>>>> > # Using SpamAssassin Auto-Whitelists With An SQL Database
>>>> > use_auto_whitelist            1
>>>> > auto_whitelist_factory        Mail::SpamAssassin::SQLBasedAddrList
>>>> > user_awl_dsn
>>>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>>>> > user_awl_sql_username         spamassassin
>>>> > user_awl_sql_password         ***
>>>> > user_awl_sql_table            awl
>>>> >
>>>> > # Using A SQL Database for Bayesian Storage Module
>>>> > use_bayes                     1
>>>> > use_bayes_rules               1
>>>> > bayes_auto_learn              1
>>>> > bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
>>>> > bayes_sql_dsn
>>>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>>>> > bayes_sql_username            spamassassin
>>>> > bayes_sql_password            ***
>>>> > bayes_min_ham_num             100
>>>> > bayes_min_spam_num            100
>>>> > bayes_learn_during_report     1
>>>> > bayes_expiry_max_db_size      180000
>>>> > bayes_auto_expire             0
>>>> > bayes_journal_max_size        102400
>>>> > bayes_learn_to_journal        0
>>>> > bayes_use_hapaxes             1
>>>> > bayes_sql_override_username  spamassassin
>>>> >
>>>> > add_header all BayesScore _BAYES_
>>>> > add_header all TokenSummary _TOKENSUMMARY_
>>>> > add_header all Bayestc _BAYESTC_
>>>> > add_header all Bayestcleanred  _BAYESTCLEARNED_
>>>> > add_header all bayestcspammy _BAYESTCSPAMMY_
>>>> > add_header all bayestchammy  _BAYESTCHAMMY_
>>>> > add_header all bayestop5hammytokens  _HAMMYTOKENS(5)_
>>>> > add_header all bayestop5spammytokens  _SPAMMYTOKENS(5)_
>>>> > score BODY_ENHANCEMENT 5.0
>>>> > score BODY_ENHANCEMENT2 5.0
>>>> > score DRUGS_ERECTILE 20.0
>>>> > score FB_CIALIS_LEO3 5.0
>>>> > score FRT_LEVITRA 5.0
>>>> > score FUZZY_CPILL 5.0
>>>> > score FUZZY_VPILL 5.0
>>>> > score SARE_ADULT2 5.0
>>>> > score SARE_SXLIFE 5.0
>>>> > score SARE_WEOFFER 5.0
>>>> > score FB_ADD_INCHES 5.0
>>>> > #score RCVD_IN_NJABL_DUL 2.9
>>>> > #score RAZOR2_CF_RANGE_51_100 1.5
>>>> > score DATE_IN_FUTURE_03_06 3.5
>>>> > score DATE_IN_FUTURE_06_12 2.5
>>>> > score  CHARSET_FARAWAY 6.0
>>>> > score  CHARSET_FARAWAY_HEADER 6.0
>>>> > # How many hits before a message is considered spam.
>>>> > required_score  5.00
>>>> > # Text to prepend to subject if rewrite_subject is used
>>>> > rewrite_header Subject  [SPAM]
>>>> > # Encapsulate spam in an attachment
>>>> > report_safe     0
>>>> > # Enable or disable network checks
>>>> > skip_rbl_checks               1
>>>> > # Mail using locales used in these country codes will not be marked
>>>> > # as being possibly spam in a foreign language.
>>>> > ok_locales                    all
>>>> > # All cusom directives may be added to
>>>> > /hsphere/local/config/mail/spamassassin/custom.cf
>>>> > include /hsphere/local/config/mail/spamassassin/custom.cf
>>>> >
>>>> >
>>>> > -- Mitch
>>>> >
>>>> >
>>>> >
>>>> > Leveau Stanislas wrote:
>>>> >> Hi
>>>> >>
>>>> >> Can you show us your spamassassin configuration : local.cf
>>>> >>
>>>> >> Thanks
>>>> >>
>>>> >>> Mitchell Hudson schrieb am 19.03.2008 18:18:
>>>> >>>
>>>> >>>> I have a few questions though, you said I am not using   
>>>> >>>> bayes_sql_override_username  but I have   
>>>> >>>> "bayes_sql_override_username  spamassassin " in my config, does   
>>>> >>>> that not count?
>>>> >>>
>>>> >>> I'm sorry, I overlooked that. Yes, in the configuration that 
>>>> you posted
>>>> >>> it was set. And I also told rubbish by claiming that you ran 
>>>> under the
>>>> >>> username root. SA reported the internal userid from the sql 
>>>> table, and
>>>> >>> that was probably the user 'spamassassin'.
>>>> >>>
>>>> >>>> As well I tried setting the min_ham and min_spam to 1 just for 
>>>> a   
>>>> >>>> short test, and took out the bayes_sql_override_username  and 
>>>> it   
>>>> >>>> wasn't calling. When I did the use spamassassin; select * from   
>>>> >>>> bayes_vars; I did get a list of people, but they have very few   
>>>> >>>> tokens, in the order of 1 or 2 which looks to me like those 
>>>> >>>> tokens  were created when I was tinkering and removed the   
>>>> >>>> sql_override_username, otherwise everything is put into the   
>>>> >>>> spamassassin user which has a few hundred thousand tokens in it   
>>>> >>>> currently.
>>>> >>>
>>>> >>> Yes, that's a valid explanation. Sorry for the confusion from 
>>>> my part.
>>>> >>> But that leads us back to your question: "why it is not 
>>>> scoring?". Did
>>>> >>> you really found all bayes-related output from --lint? If I run a
>>>> >>> "spamassassin --lint -D 2>&1|grep -i bayes", I get more 
>>>> bayes-related
>>>> >>> output:
>>>> >>>
>>>> >>> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes 
>>>> from @INC
>>>> >>> [21631] dbg: config: fixed relative path:
>>>> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>>> >>> [21631] dbg: config: using
>>>> >>> 
>>>> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
>>>> >>> for included file
>>>> >>> [21631] dbg: config: read file
>>>> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>>> >>> [21631] dbg: bayes: using username: mail
>>>> >>> [21631] dbg: bayes: database connection established
>>>> >>> [21631] dbg: bayes: found bayes db version 3
>>>> >>> [21631] dbg: bayes: Using userid: 2
>>>> >>> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
>>>> >>> [21631] dbg: bayes: tok_get_all: token count: 21
>>>> >>> [21631] dbg: bayes: score = 0.0020110638266459
>>>> >>> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max 
>>>> size:
>>>> >>> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
>>>> >>> expire: 1205444421, Current time: 1205950517
>>>> >>> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
>>>> >>> [21631] dbg: check:
>>>> >>> 
>>>> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS 
>>>> I am using Mysql as 
>>>> >>> database.
>>>> >>>
>>>> >>> Tschau
>>>> >>> Alex
>>>> >>
>>>> >>
>>>> >>


Re: Bayes not running but no errors

Posted by LEVEAU Stanislas <st...@ac-caen.fr>.
i think in your local.cf it s not Mail::SpamAssassin::BayesStore::*SQL * 
but Mail::SpamAssassin::BayesStore::*MySQL*
tries this

Mitchell Hudson a écrit :
> Hmm... I was checking around and I found a bug with apache that might 
> be related, but wanted to run it by here first:
> The bug is here: 
> https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5728
> and is related to spamd using -u in conjunction with -q and/or -Q
>
> I'm calling spamd with this command:
> /usr/bin/perl -T -w /hsphere/shared/bin/spamd --max-children=5 
> --max-conn-per-child=5 --nouser-config --sql-config 
> --username=vpopmail --socketpath=/var/hsphere/mail/spamd 
> --socketowner=vpopmail --socketgroup=vchkpw --socketmode=770 
> --syslog-socket=none
>
> If that changes anything...
>
> spamc -u rachel@academicintl.com -q 32184 -Q 100000
>
> Mitchell Hudson wrote:
>> I tried both just to be sure, but neither changed the messages when I 
>> did a --lint.
>>
>> I noticed your dsn line was different than mine, so I tried changing 
>> it to localhost from :bayes_sql_dsn                 
>> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> But then it just didn't connect to the database at all. I went 
>> through and made sure I had the perl modules installed, and I did 
>> install Mail::SpamAssassin::BayesStore::MySQL, but I already had 
>> Mail::SpamAssassin::BayesStore::SQL installed.
>>
>> It seems to be connecting to the database great, it learns and I have 
>> a ton of tokens. But it's not pulling anything back out of the 
>> database ever. I grepped back through all of my sys logs to see if 
>> anything reported during all this testing but nothing showed up.
>>
>> As always, thanks
>>
>> Leveau Stanislas wrote:
>>>
>>> My conf for an old mysql version
>>>
>>> bayes_store_module              Mail::SpamAssassin::BayesStore::*SQL*
>>> bayes_sql_dsn                   DBI:mysql:spam:localhost
>>>
>>> for a recent mysql version
>>>
>>> bayes_store_module              Mail::SpamAssassin::BayesStore::*MySQL*
>>> bayes_sql_dsn                   DBI:mysql:spam:localhost
>>>
>>>
>>> > Sure, I'll repaste the bayes portion, and include the rest of the file
>>> > for good measure. Thanks again!
>>> >
>>> > # SpamAssassin config file for version 3.2x
>>> > # Loading SpamAssassin User Preferences From An SQL Database
>>> > user_scores_dsn
>>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>>> > user_scores_sql_username      spamassassin
>>> > user_scores_sql_password      ***
>>> > # Using SpamAssassin Auto-Whitelists With An SQL Database
>>> > use_auto_whitelist            1
>>> > auto_whitelist_factory        Mail::SpamAssassin::SQLBasedAddrList
>>> > user_awl_dsn
>>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>>> > user_awl_sql_username         spamassassin
>>> > user_awl_sql_password         ***
>>> > user_awl_sql_table            awl
>>> >
>>> > # Using A SQL Database for Bayesian Storage Module
>>> > use_bayes                     1
>>> > use_bayes_rules               1
>>> > bayes_auto_learn              1
>>> > bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
>>> > bayes_sql_dsn
>>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>>> > bayes_sql_username            spamassassin
>>> > bayes_sql_password            ***
>>> > bayes_min_ham_num             100
>>> > bayes_min_spam_num            100
>>> > bayes_learn_during_report     1
>>> > bayes_expiry_max_db_size      180000
>>> > bayes_auto_expire             0
>>> > bayes_journal_max_size        102400
>>> > bayes_learn_to_journal        0
>>> > bayes_use_hapaxes             1
>>> > bayes_sql_override_username  spamassassin
>>> >
>>> > add_header all BayesScore _BAYES_
>>> > add_header all TokenSummary _TOKENSUMMARY_
>>> > add_header all Bayestc _BAYESTC_
>>> > add_header all Bayestcleanred  _BAYESTCLEARNED_
>>> > add_header all bayestcspammy _BAYESTCSPAMMY_
>>> > add_header all bayestchammy  _BAYESTCHAMMY_
>>> > add_header all bayestop5hammytokens  _HAMMYTOKENS(5)_
>>> > add_header all bayestop5spammytokens  _SPAMMYTOKENS(5)_
>>> > score BODY_ENHANCEMENT 5.0
>>> > score BODY_ENHANCEMENT2 5.0
>>> > score DRUGS_ERECTILE 20.0
>>> > score FB_CIALIS_LEO3 5.0
>>> > score FRT_LEVITRA 5.0
>>> > score FUZZY_CPILL 5.0
>>> > score FUZZY_VPILL 5.0
>>> > score SARE_ADULT2 5.0
>>> > score SARE_SXLIFE 5.0
>>> > score SARE_WEOFFER 5.0
>>> > score FB_ADD_INCHES 5.0
>>> > #score RCVD_IN_NJABL_DUL 2.9
>>> > #score RAZOR2_CF_RANGE_51_100 1.5
>>> > score DATE_IN_FUTURE_03_06 3.5
>>> > score DATE_IN_FUTURE_06_12 2.5
>>> > score  CHARSET_FARAWAY 6.0
>>> > score  CHARSET_FARAWAY_HEADER 6.0
>>> > # How many hits before a message is considered spam.
>>> > required_score  5.00
>>> > # Text to prepend to subject if rewrite_subject is used
>>> > rewrite_header Subject  [SPAM]
>>> > # Encapsulate spam in an attachment
>>> > report_safe     0
>>> > # Enable or disable network checks
>>> > skip_rbl_checks               1
>>> > # Mail using locales used in these country codes will not be marked
>>> > # as being possibly spam in a foreign language.
>>> > ok_locales                    all
>>> > # All cusom directives may be added to
>>> > /hsphere/local/config/mail/spamassassin/custom.cf
>>> > include /hsphere/local/config/mail/spamassassin/custom.cf
>>> >
>>> >
>>> > -- Mitch
>>> >
>>> >
>>> >
>>> > Leveau Stanislas wrote:
>>> >> Hi
>>> >>
>>> >> Can you show us your spamassassin configuration : local.cf
>>> >>
>>> >> Thanks
>>> >>
>>> >>> Mitchell Hudson schrieb am 19.03.2008 18:18:
>>> >>>
>>> >>>> I have a few questions though, you said I am not using   
>>> >>>> bayes_sql_override_username  but I have   
>>> >>>> "bayes_sql_override_username  spamassassin " in my config, does   
>>> >>>> that not count?
>>> >>>
>>> >>> I'm sorry, I overlooked that. Yes, in the configuration that you 
>>> posted
>>> >>> it was set. And I also told rubbish by claiming that you ran 
>>> under the
>>> >>> username root. SA reported the internal userid from the sql 
>>> table, and
>>> >>> that was probably the user 'spamassassin'.
>>> >>>
>>> >>>> As well I tried setting the min_ham and min_spam to 1 just for a   
>>> >>>> short test, and took out the bayes_sql_override_username  and it   
>>> >>>> wasn't calling. When I did the use spamassassin; select * from   
>>> >>>> bayes_vars; I did get a list of people, but they have very few   
>>> >>>> tokens, in the order of 1 or 2 which looks to me like those 
>>> >>>> tokens  were created when I was tinkering and removed the   
>>> >>>> sql_override_username, otherwise everything is put into the   
>>> >>>> spamassassin user which has a few hundred thousand tokens in it   
>>> >>>> currently.
>>> >>>
>>> >>> Yes, that's a valid explanation. Sorry for the confusion from my 
>>> part.
>>> >>> But that leads us back to your question: "why it is not 
>>> scoring?". Did
>>> >>> you really found all bayes-related output from --lint? If I run a
>>> >>> "spamassassin --lint -D 2>&1|grep -i bayes", I get more 
>>> bayes-related
>>> >>> output:
>>> >>>
>>> >>> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes 
>>> from @INC
>>> >>> [21631] dbg: config: fixed relative path:
>>> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>> >>> [21631] dbg: config: using
>>> >>> 
>>> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
>>> >>> for included file
>>> >>> [21631] dbg: config: read file
>>> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>> >>> [21631] dbg: bayes: using username: mail
>>> >>> [21631] dbg: bayes: database connection established
>>> >>> [21631] dbg: bayes: found bayes db version 3
>>> >>> [21631] dbg: bayes: Using userid: 2
>>> >>> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
>>> >>> [21631] dbg: bayes: tok_get_all: token count: 21
>>> >>> [21631] dbg: bayes: score = 0.0020110638266459
>>> >>> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max 
>>> size:
>>> >>> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
>>> >>> expire: 1205444421, Current time: 1205950517
>>> >>> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
>>> >>> [21631] dbg: check:
>>> >>> 
>>> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS 
>>> I am using Mysql as 
>>> >>> database.
>>> >>>
>>> >>> Tschau
>>> >>> Alex
>>> >>
>>> >>
>>> >>
>>>
>>
>> -- 
>> --
>> Mitchell Hudson
>> Systems Administrator
>> Front Gate Solutions
>> 1711 S Congress Ave
>> Austin, TX 78704
>> P: 512-674-9337
>> C: 512-587-0918
>> F: 512-499-0440
>> Mitchell@FrontGateSolutions.com
>
> -- 
> --
> Mitchell Hudson
> Systems Administrator
> Front Gate Solutions
> 1711 S Congress Ave
> Austin, TX 78704
> P: 512-674-9337
> C: 512-587-0918
> F: 512-499-0440
> Mitchell@FrontGateSolutions.com

-- 
*LEVEAU Stanislas**
*Rectorat de Caen
SIAC
168, rue Caponière
B.P. 6184
14061 CAEN Cedex
	/

Service Informatique de l'académie de Caen
Département Systèmes & Réseaux/


 Tel : 02.31.30.17.86




Re: Bayes not running but no errors

Posted by Mitchell Hudson <mi...@frontgatesolutions.com>.
Hmm... I was checking around and I found a bug with apache that might be 
related, but wanted to run it by here first:
The bug is here: 
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5728
and is related to spamd using -u in conjunction with -q and/or -Q

I'm calling spamd with this command:
/usr/bin/perl -T -w /hsphere/shared/bin/spamd --max-children=5 
--max-conn-per-child=5 --nouser-config --sql-config --username=vpopmail 
--socketpath=/var/hsphere/mail/spamd --socketowner=vpopmail 
--socketgroup=vchkpw --socketmode=770 --syslog-socket=none

If that changes anything...

spamc -u rachel@academicintl.com -q 32184 -Q 100000

Mitchell Hudson wrote:
> I tried both just to be sure, but neither changed the messages when I 
> did a --lint.
>
> I noticed your dsn line was different than mine, so I tried changing 
> it to localhost from :bayes_sql_dsn                 
> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> But then it just didn't connect to the database at all. I went through 
> and made sure I had the perl modules installed, and I did install 
> Mail::SpamAssassin::BayesStore::MySQL, but I already had 
> Mail::SpamAssassin::BayesStore::SQL installed.
>
> It seems to be connecting to the database great, it learns and I have 
> a ton of tokens. But it's not pulling anything back out of the 
> database ever. I grepped back through all of my sys logs to see if 
> anything reported during all this testing but nothing showed up.
>
> As always, thanks
>
> Leveau Stanislas wrote:
>>
>> My conf for an old mysql version
>>
>> bayes_store_module              Mail::SpamAssassin::BayesStore::*SQL*
>> bayes_sql_dsn                   DBI:mysql:spam:localhost
>>
>> for a recent mysql version
>>
>> bayes_store_module              Mail::SpamAssassin::BayesStore::*MySQL*
>> bayes_sql_dsn                   DBI:mysql:spam:localhost
>>
>>
>> > Sure, I'll repaste the bayes portion, and include the rest of the file
>> > for good measure. Thanks again!
>> >
>> > # SpamAssassin config file for version 3.2x
>> > # Loading SpamAssassin User Preferences From An SQL Database
>> > user_scores_dsn
>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> > user_scores_sql_username      spamassassin
>> > user_scores_sql_password      ***
>> > # Using SpamAssassin Auto-Whitelists With An SQL Database
>> > use_auto_whitelist            1
>> > auto_whitelist_factory        Mail::SpamAssassin::SQLBasedAddrList
>> > user_awl_dsn
>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> > user_awl_sql_username         spamassassin
>> > user_awl_sql_password         ***
>> > user_awl_sql_table            awl
>> >
>> > # Using A SQL Database for Bayesian Storage Module
>> > use_bayes                     1
>> > use_bayes_rules               1
>> > bayes_auto_learn              1
>> > bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
>> > bayes_sql_dsn
>> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> > bayes_sql_username            spamassassin
>> > bayes_sql_password            ***
>> > bayes_min_ham_num             100
>> > bayes_min_spam_num            100
>> > bayes_learn_during_report     1
>> > bayes_expiry_max_db_size      180000
>> > bayes_auto_expire             0
>> > bayes_journal_max_size        102400
>> > bayes_learn_to_journal        0
>> > bayes_use_hapaxes             1
>> > bayes_sql_override_username  spamassassin
>> >
>> > add_header all BayesScore _BAYES_
>> > add_header all TokenSummary _TOKENSUMMARY_
>> > add_header all Bayestc _BAYESTC_
>> > add_header all Bayestcleanred  _BAYESTCLEARNED_
>> > add_header all bayestcspammy _BAYESTCSPAMMY_
>> > add_header all bayestchammy  _BAYESTCHAMMY_
>> > add_header all bayestop5hammytokens  _HAMMYTOKENS(5)_
>> > add_header all bayestop5spammytokens  _SPAMMYTOKENS(5)_
>> > score BODY_ENHANCEMENT 5.0
>> > score BODY_ENHANCEMENT2 5.0
>> > score DRUGS_ERECTILE 20.0
>> > score FB_CIALIS_LEO3 5.0
>> > score FRT_LEVITRA 5.0
>> > score FUZZY_CPILL 5.0
>> > score FUZZY_VPILL 5.0
>> > score SARE_ADULT2 5.0
>> > score SARE_SXLIFE 5.0
>> > score SARE_WEOFFER 5.0
>> > score FB_ADD_INCHES 5.0
>> > #score RCVD_IN_NJABL_DUL 2.9
>> > #score RAZOR2_CF_RANGE_51_100 1.5
>> > score DATE_IN_FUTURE_03_06 3.5
>> > score DATE_IN_FUTURE_06_12 2.5
>> > score  CHARSET_FARAWAY 6.0
>> > score  CHARSET_FARAWAY_HEADER 6.0
>> > # How many hits before a message is considered spam.
>> > required_score  5.00
>> > # Text to prepend to subject if rewrite_subject is used
>> > rewrite_header Subject  [SPAM]
>> > # Encapsulate spam in an attachment
>> > report_safe     0
>> > # Enable or disable network checks
>> > skip_rbl_checks               1
>> > # Mail using locales used in these country codes will not be marked
>> > # as being possibly spam in a foreign language.
>> > ok_locales                    all
>> > # All cusom directives may be added to
>> > /hsphere/local/config/mail/spamassassin/custom.cf
>> > include /hsphere/local/config/mail/spamassassin/custom.cf
>> >
>> >
>> > -- Mitch
>> >
>> >
>> >
>> > Leveau Stanislas wrote:
>> >> Hi
>> >>
>> >> Can you show us your spamassassin configuration : local.cf
>> >>
>> >> Thanks
>> >>
>> >>> Mitchell Hudson schrieb am 19.03.2008 18:18:
>> >>>
>> >>>> I have a few questions though, you said I am not using   
>> >>>> bayes_sql_override_username  but I have   
>> >>>> "bayes_sql_override_username  spamassassin " in my config, does   
>> >>>> that not count?
>> >>>
>> >>> I'm sorry, I overlooked that. Yes, in the configuration that you 
>> posted
>> >>> it was set. And I also told rubbish by claiming that you ran 
>> under the
>> >>> username root. SA reported the internal userid from the sql 
>> table, and
>> >>> that was probably the user 'spamassassin'.
>> >>>
>> >>>> As well I tried setting the min_ham and min_spam to 1 just for a   
>> >>>> short test, and took out the bayes_sql_override_username  and it   
>> >>>> wasn't calling. When I did the use spamassassin; select * from   
>> >>>> bayes_vars; I did get a list of people, but they have very few   
>> >>>> tokens, in the order of 1 or 2 which looks to me like those 
>> >>>> tokens  were created when I was tinkering and removed the   
>> >>>> sql_override_username, otherwise everything is put into the   
>> >>>> spamassassin user which has a few hundred thousand tokens in it   
>> >>>> currently.
>> >>>
>> >>> Yes, that's a valid explanation. Sorry for the confusion from my 
>> part.
>> >>> But that leads us back to your question: "why it is not 
>> scoring?". Did
>> >>> you really found all bayes-related output from --lint? If I run a
>> >>> "spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related
>> >>> output:
>> >>>
>> >>> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes 
>> from @INC
>> >>> [21631] dbg: config: fixed relative path:
>> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>> >>> [21631] dbg: config: using
>> >>> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
>> >>> for included file
>> >>> [21631] dbg: config: read file
>> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>> >>> [21631] dbg: bayes: using username: mail
>> >>> [21631] dbg: bayes: database connection established
>> >>> [21631] dbg: bayes: found bayes db version 3
>> >>> [21631] dbg: bayes: Using userid: 2
>> >>> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
>> >>> [21631] dbg: bayes: tok_get_all: token count: 21
>> >>> [21631] dbg: bayes: score = 0.0020110638266459
>> >>> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size:
>> >>> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
>> >>> expire: 1205444421, Current time: 1205950517
>> >>> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
>> >>> [21631] dbg: check:
>> >>> 
>> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS 
>> I am using Mysql as 
>> >>> database.
>> >>>
>> >>> Tschau
>> >>> Alex
>> >>
>> >>
>> >>
>>
>
> -- 
> --
> Mitchell Hudson
> Systems Administrator
> Front Gate Solutions
> 1711 S Congress Ave
> Austin, TX 78704
> P: 512-674-9337
> C: 512-587-0918
> F: 512-499-0440
> Mitchell@FrontGateSolutions.com

-- 
--
Mitchell Hudson
Systems Administrator
Front Gate Solutions
1711 S Congress Ave
Austin, TX 78704
P: 512-674-9337
C: 512-587-0918
F: 512-499-0440
Mitchell@FrontGateSolutions.com


Re: Bayes not running but no errors

Posted by Mitchell Hudson <mi...@frontgatesolutions.com>.
I tried both just to be sure, but neither changed the messages when I 
did a --lint.

I noticed your dsn line was different than mine, so I tried changing it 
to localhost from :bayes_sql_dsn                 
DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
But then it just didn't connect to the database at all. I went through 
and made sure I had the perl modules installed, and I did install 
Mail::SpamAssassin::BayesStore::MySQL, but I already had 
Mail::SpamAssassin::BayesStore::SQL installed.

It seems to be connecting to the database great, it learns and I have a 
ton of tokens. But it's not pulling anything back out of the database 
ever. I grepped back through all of my sys logs to see if anything 
reported during all this testing but nothing showed up.

As always, thanks

Leveau Stanislas wrote:
>
> My conf for an old mysql version
>
> bayes_store_module              Mail::SpamAssassin::BayesStore::*SQL*
> bayes_sql_dsn                   DBI:mysql:spam:localhost
>
> for a recent mysql version
>
> bayes_store_module              Mail::SpamAssassin::BayesStore::*MySQL*
> bayes_sql_dsn                   DBI:mysql:spam:localhost
>
>
> > Sure, I'll repaste the bayes portion, and include the rest of the file
> > for good measure. Thanks again!
> >
> > # SpamAssassin config file for version 3.2x
> > # Loading SpamAssassin User Preferences From An SQL Database
> > user_scores_dsn
> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> > user_scores_sql_username      spamassassin
> > user_scores_sql_password      ***
> > # Using SpamAssassin Auto-Whitelists With An SQL Database
> > use_auto_whitelist            1
> > auto_whitelist_factory        Mail::SpamAssassin::SQLBasedAddrList
> > user_awl_dsn
> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> > user_awl_sql_username         spamassassin
> > user_awl_sql_password         ***
> > user_awl_sql_table            awl
> >
> > # Using A SQL Database for Bayesian Storage Module
> > use_bayes                     1
> > use_bayes_rules               1
> > bayes_auto_learn              1
> > bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
> > bayes_sql_dsn
> > DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> > bayes_sql_username            spamassassin
> > bayes_sql_password            ***
> > bayes_min_ham_num             100
> > bayes_min_spam_num            100
> > bayes_learn_during_report     1
> > bayes_expiry_max_db_size      180000
> > bayes_auto_expire             0
> > bayes_journal_max_size        102400
> > bayes_learn_to_journal        0
> > bayes_use_hapaxes             1
> > bayes_sql_override_username  spamassassin
> >
> > add_header all BayesScore _BAYES_
> > add_header all TokenSummary _TOKENSUMMARY_
> > add_header all Bayestc _BAYESTC_
> > add_header all Bayestcleanred  _BAYESTCLEARNED_
> > add_header all bayestcspammy _BAYESTCSPAMMY_
> > add_header all bayestchammy  _BAYESTCHAMMY_
> > add_header all bayestop5hammytokens  _HAMMYTOKENS(5)_
> > add_header all bayestop5spammytokens  _SPAMMYTOKENS(5)_
> > score BODY_ENHANCEMENT 5.0
> > score BODY_ENHANCEMENT2 5.0
> > score DRUGS_ERECTILE 20.0
> > score FB_CIALIS_LEO3 5.0
> > score FRT_LEVITRA 5.0
> > score FUZZY_CPILL 5.0
> > score FUZZY_VPILL 5.0
> > score SARE_ADULT2 5.0
> > score SARE_SXLIFE 5.0
> > score SARE_WEOFFER 5.0
> > score FB_ADD_INCHES 5.0
> > #score RCVD_IN_NJABL_DUL 2.9
> > #score RAZOR2_CF_RANGE_51_100 1.5
> > score DATE_IN_FUTURE_03_06 3.5
> > score DATE_IN_FUTURE_06_12 2.5
> > score  CHARSET_FARAWAY 6.0
> > score  CHARSET_FARAWAY_HEADER 6.0
> > # How many hits before a message is considered spam.
> > required_score  5.00
> > # Text to prepend to subject if rewrite_subject is used
> > rewrite_header Subject  [SPAM]
> > # Encapsulate spam in an attachment
> > report_safe     0
> > # Enable or disable network checks
> > skip_rbl_checks               1
> > # Mail using locales used in these country codes will not be marked
> > # as being possibly spam in a foreign language.
> > ok_locales                    all
> > # All cusom directives may be added to
> > /hsphere/local/config/mail/spamassassin/custom.cf
> > include /hsphere/local/config/mail/spamassassin/custom.cf
> >
> >
> > -- Mitch
> >
> >
> >
> > Leveau Stanislas wrote:
> >> Hi
> >>
> >> Can you show us your spamassassin configuration : local.cf
> >>
> >> Thanks
> >>
> >>> Mitchell Hudson schrieb am 19.03.2008 18:18:
> >>>
> >>>> I have a few questions though, you said I am not using   
> >>>> bayes_sql_override_username  but I have   
> >>>> "bayes_sql_override_username  spamassassin " in my config, does   
> >>>> that not count?
> >>>
> >>> I'm sorry, I overlooked that. Yes, in the configuration that you 
> posted
> >>> it was set. And I also told rubbish by claiming that you ran under the
> >>> username root. SA reported the internal userid from the sql table, and
> >>> that was probably the user 'spamassassin'.
> >>>
> >>>> As well I tried setting the min_ham and min_spam to 1 just for a   
> >>>> short test, and took out the bayes_sql_override_username  and it   
> >>>> wasn't calling. When I did the use spamassassin; select * from   
> >>>> bayes_vars; I did get a list of people, but they have very few   
> >>>> tokens, in the order of 1 or 2 which looks to me like those 
> >>>> tokens  were created when I was tinkering and removed the   
> >>>> sql_override_username, otherwise everything is put into the   
> >>>> spamassassin user which has a few hundred thousand tokens in it   
> >>>> currently.
> >>>
> >>> Yes, that's a valid explanation. Sorry for the confusion from my part.
> >>> But that leads us back to your question: "why it is not scoring?". Did
> >>> you really found all bayes-related output from --lint? If I run a
> >>> "spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related
> >>> output:
> >>>
> >>> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes 
> from @INC
> >>> [21631] dbg: config: fixed relative path:
> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
> >>> [21631] dbg: config: using
> >>> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
> >>> for included file
> >>> [21631] dbg: config: read file
> >>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
> >>> [21631] dbg: bayes: using username: mail
> >>> [21631] dbg: bayes: database connection established
> >>> [21631] dbg: bayes: found bayes db version 3
> >>> [21631] dbg: bayes: Using userid: 2
> >>> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
> >>> [21631] dbg: bayes: tok_get_all: token count: 21
> >>> [21631] dbg: bayes: score = 0.0020110638266459
> >>> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size:
> >>> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
> >>> expire: 1205444421, Current time: 1205950517
> >>> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
> >>> [21631] dbg: check:
> >>> 
> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS 
> I am using Mysql as 
> >>> database.
> >>>
> >>> Tschau
> >>> Alex
> >>
> >>
> >>
>

-- 
--
Mitchell Hudson
Systems Administrator
Front Gate Solutions
1711 S Congress Ave
Austin, TX 78704
P: 512-674-9337
C: 512-587-0918
F: 512-499-0440
Mitchell@FrontGateSolutions.com


Re: Bayes not running but no errors

Posted by Leveau Stanislas <st...@ac-caen.fr>.
My conf for an old mysql version

bayes_store_module              Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn                   DBI:mysql:spam:localhost

for a recent mysql version

bayes_store_module              Mail::SpamAssassin::BayesStore::MYSQL
bayes_sql_dsn                   DBI:mysql:spam:localhost

> Sure, I'll repaste the bayes portion, and include the rest of the file
> for good measure. Thanks again!
>
> # SpamAssassin config file for version 3.2x
> # Loading SpamAssassin User Preferences From An SQL Database
> user_scores_dsn
> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> user_scores_sql_username      spamassassin
> user_scores_sql_password      ***
> # Using SpamAssassin Auto-Whitelists With An SQL Database
> use_auto_whitelist            1
> auto_whitelist_factory        Mail::SpamAssassin::SQLBasedAddrList
> user_awl_dsn
> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> user_awl_sql_username         spamassassin
> user_awl_sql_password         ***
> user_awl_sql_table            awl
>
> # Using A SQL Database for Bayesian Storage Module
> use_bayes                     1
> use_bayes_rules               1
> bayes_auto_learn              1
> bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
> bayes_sql_dsn
> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> bayes_sql_username            spamassassin
> bayes_sql_password            ***
> bayes_min_ham_num             100
> bayes_min_spam_num            100
> bayes_learn_during_report     1
> bayes_expiry_max_db_size      180000
> bayes_auto_expire             0
> bayes_journal_max_size        102400
> bayes_learn_to_journal        0
> bayes_use_hapaxes             1
> bayes_sql_override_username  spamassassin
>
> add_header all BayesScore _BAYES_
> add_header all TokenSummary _TOKENSUMMARY_
> add_header all Bayestc _BAYESTC_
> add_header all Bayestcleanred  _BAYESTCLEARNED_
> add_header all bayestcspammy _BAYESTCSPAMMY_
> add_header all bayestchammy  _BAYESTCHAMMY_
> add_header all bayestop5hammytokens  _HAMMYTOKENS(5)_
> add_header all bayestop5spammytokens  _SPAMMYTOKENS(5)_
> score BODY_ENHANCEMENT 5.0
> score BODY_ENHANCEMENT2 5.0
> score DRUGS_ERECTILE 20.0
> score FB_CIALIS_LEO3 5.0
> score FRT_LEVITRA 5.0
> score FUZZY_CPILL 5.0
> score FUZZY_VPILL 5.0
> score SARE_ADULT2 5.0
> score SARE_SXLIFE 5.0
> score SARE_WEOFFER 5.0
> score FB_ADD_INCHES 5.0
> #score RCVD_IN_NJABL_DUL 2.9
> #score RAZOR2_CF_RANGE_51_100 1.5
> score DATE_IN_FUTURE_03_06 3.5
> score DATE_IN_FUTURE_06_12 2.5
> score  CHARSET_FARAWAY 6.0
> score  CHARSET_FARAWAY_HEADER 6.0
> # How many hits before a message is considered spam.
> required_score  5.00
> # Text to prepend to subject if rewrite_subject is used
> rewrite_header Subject  [SPAM]
> # Encapsulate spam in an attachment
> report_safe     0
> # Enable or disable network checks
> skip_rbl_checks               1
> # Mail using locales used in these country codes will not be marked
> # as being possibly spam in a foreign language.
> ok_locales                    all
> # All cusom directives may be added to
> /hsphere/local/config/mail/spamassassin/custom.cf
> include /hsphere/local/config/mail/spamassassin/custom.cf
>
>
> -- Mitch
>
>
>
> Leveau Stanislas wrote:
>> Hi
>>
>> Can you show us your spamassassin configuration : local.cf
>>
>> Thanks
>>
>>> Mitchell Hudson schrieb am 19.03.2008 18:18:
>>>
>>>> I have a few questions though, you said I am not using   
>>>> bayes_sql_override_username  but I have   
>>>> "bayes_sql_override_username  spamassassin " in my config, does   
>>>> that not count?
>>>
>>> I'm sorry, I overlooked that. Yes, in the configuration that you posted
>>> it was set. And I also told rubbish by claiming that you ran under the
>>> username root. SA reported the internal userid from the sql table, and
>>> that was probably the user 'spamassassin'.
>>>
>>>> As well I tried setting the min_ham and min_spam to 1 just for a   
>>>> short test, and took out the bayes_sql_override_username  and it   
>>>> wasn't calling. When I did the use spamassassin; select * from   
>>>> bayes_vars; I did get a list of people, but they have very few   
>>>> tokens, in the order of 1 or 2 which looks to me like those   
>>>> tokens  were created when I was tinkering and removed the   
>>>> sql_override_username, otherwise everything is put into the   
>>>> spamassassin user which has a few hundred thousand tokens in it   
>>>> currently.
>>>
>>> Yes, that's a valid explanation. Sorry for the confusion from my part.
>>> But that leads us back to your question: "why it is not scoring?". Did
>>> you really found all bayes-related output from --lint? If I run a
>>> "spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related
>>> output:
>>>
>>> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from @INC
>>> [21631] dbg: config: fixed relative path:
>>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>> [21631] dbg: config: using
>>> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
>>> for included file
>>> [21631] dbg: config: read file
>>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>> [21631] dbg: bayes: using username: mail
>>> [21631] dbg: bayes: database connection established
>>> [21631] dbg: bayes: found bayes db version 3
>>> [21631] dbg: bayes: Using userid: 2
>>> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
>>> [21631] dbg: bayes: tok_get_all: token count: 21
>>> [21631] dbg: bayes: score = 0.0020110638266459
>>> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size:
>>> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
>>> expire: 1205444421, Current time: 1205950517
>>> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
>>> [21631] dbg: check:
>>> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS I am using Mysql as   
>>> database.
>>>
>>> Tschau
>>> Alex
>>
>>
>>



Re: Bayes not running but no errors

Posted by Mitchell Hudson <mi...@frontgatesolutions.com>.
Hope this helps:

# mysql -V
mysql  Ver 14.12 Distrib 5.0.44, for pc-linux-gnu (i686) using readline 4.3

It would be nice if it was a mysql problem, those are usually easy 
enough to fix, but I couldn't find any bugs related to what I'm seeing, 
though I could certainly have missed something.

Leveau Stanislas wrote:
> what is your mysql version?
>
>> Sure, I'll repaste the bayes portion, and include the rest of the file
>> for good measure. Thanks again!
>>
>> # SpamAssassin config file for version 3.2x
>> # Loading SpamAssassin User Preferences From An SQL Database
>> user_scores_dsn
>> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> user_scores_sql_username      spamassassin
>> user_scores_sql_password      ***
>> # Using SpamAssassin Auto-Whitelists With An SQL Database
>> use_auto_whitelist            1
>> auto_whitelist_factory        Mail::SpamAssassin::SQLBasedAddrList
>> user_awl_dsn
>> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> user_awl_sql_username         spamassassin
>> user_awl_sql_password         ***
>> user_awl_sql_table            awl
>>
>> # Using A SQL Database for Bayesian Storage Module
>> use_bayes                     1
>> use_bayes_rules               1
>> bayes_auto_learn              1
>> bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
>> bayes_sql_dsn
>> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> bayes_sql_username            spamassassin
>> bayes_sql_password            ***
>> bayes_min_ham_num             100
>> bayes_min_spam_num            100
>> bayes_learn_during_report     1
>> bayes_expiry_max_db_size      180000
>> bayes_auto_expire             0
>> bayes_journal_max_size        102400
>> bayes_learn_to_journal        0
>> bayes_use_hapaxes             1
>> bayes_sql_override_username  spamassassin
>>
>> add_header all BayesScore _BAYES_
>> add_header all TokenSummary _TOKENSUMMARY_
>> add_header all Bayestc _BAYESTC_
>> add_header all Bayestcleanred  _BAYESTCLEARNED_
>> add_header all bayestcspammy _BAYESTCSPAMMY_
>> add_header all bayestchammy  _BAYESTCHAMMY_
>> add_header all bayestop5hammytokens  _HAMMYTOKENS(5)_
>> add_header all bayestop5spammytokens  _SPAMMYTOKENS(5)_
>> score BODY_ENHANCEMENT 5.0
>> score BODY_ENHANCEMENT2 5.0
>> score DRUGS_ERECTILE 20.0
>> score FB_CIALIS_LEO3 5.0
>> score FRT_LEVITRA 5.0
>> score FUZZY_CPILL 5.0
>> score FUZZY_VPILL 5.0
>> score SARE_ADULT2 5.0
>> score SARE_SXLIFE 5.0
>> score SARE_WEOFFER 5.0
>> score FB_ADD_INCHES 5.0
>> #score RCVD_IN_NJABL_DUL 2.9
>> #score RAZOR2_CF_RANGE_51_100 1.5
>> score DATE_IN_FUTURE_03_06 3.5
>> score DATE_IN_FUTURE_06_12 2.5
>> score  CHARSET_FARAWAY 6.0
>> score  CHARSET_FARAWAY_HEADER 6.0
>> # How many hits before a message is considered spam.
>> required_score  5.00
>> # Text to prepend to subject if rewrite_subject is used
>> rewrite_header Subject  [SPAM]
>> # Encapsulate spam in an attachment
>> report_safe     0
>> # Enable or disable network checks
>> skip_rbl_checks               1
>> # Mail using locales used in these country codes will not be marked
>> # as being possibly spam in a foreign language.
>> ok_locales                    all
>> # All cusom directives may be added to
>> /hsphere/local/config/mail/spamassassin/custom.cf
>> include /hsphere/local/config/mail/spamassassin/custom.cf
>>
>>
>> -- Mitch
>>
>>
>>
>> Leveau Stanislas wrote:
>>> Hi
>>>
>>> Can you show us your spamassassin configuration : local.cf
>>>
>>> Thanks
>>>
>>>> Mitchell Hudson schrieb am 19.03.2008 18:18:
>>>>
>>>>> I have a few questions though, you said I am not using   
>>>>> bayes_sql_override_username  but I have   
>>>>> "bayes_sql_override_username  spamassassin " in my config, does   
>>>>> that not count?
>>>>
>>>> I'm sorry, I overlooked that. Yes, in the configuration that you 
>>>> posted
>>>> it was set. And I also told rubbish by claiming that you ran under the
>>>> username root. SA reported the internal userid from the sql table, and
>>>> that was probably the user 'spamassassin'.
>>>>
>>>>> As well I tried setting the min_ham and min_spam to 1 just for a  
>>>>>  short test, and took out the bayes_sql_override_username  and it 
>>>>>   wasn't calling. When I did the use spamassassin; select * from  
>>>>>  bayes_vars; I did get a list of people, but they have very few   
>>>>> tokens, in the order of 1 or 2 which looks to me like those  
>>>>> tokens  were created when I was tinkering and removed the   
>>>>> sql_override_username, otherwise everything is put into the   
>>>>> spamassassin user which has a few hundred thousand tokens in it   
>>>>> currently.
>>>>
>>>> Yes, that's a valid explanation. Sorry for the confusion from my part.
>>>> But that leads us back to your question: "why it is not scoring?". Did
>>>> you really found all bayes-related output from --lint? If I run a
>>>> "spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related
>>>> output:
>>>>
>>>> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from 
>>>> @INC
>>>> [21631] dbg: config: fixed relative path:
>>>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>>> [21631] dbg: config: using
>>>> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
>>>> for included file
>>>> [21631] dbg: config: read file
>>>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>>>> [21631] dbg: bayes: using username: mail
>>>> [21631] dbg: bayes: database connection established
>>>> [21631] dbg: bayes: found bayes db version 3
>>>> [21631] dbg: bayes: Using userid: 2
>>>> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
>>>> [21631] dbg: bayes: tok_get_all: token count: 21
>>>> [21631] dbg: bayes: score = 0.0020110638266459
>>>> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size:
>>>> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
>>>> expire: 1205444421, Current time: 1205950517
>>>> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
>>>> [21631] dbg: check:
>>>> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS 
>>>> I am using Mysql as  database.
>>>>
>>>> Tschau
>>>> Alex
>>>
>>>
>>>
>
>
>

-- 
--
Mitchell Hudson
Systems Administrator
Front Gate Solutions
1711 S Congress Ave
Austin, TX 78704
P: 512-674-9337
C: 512-587-0918
F: 512-499-0440
Mitchell@FrontGateSolutions.com



Re: Bayes not running but no errors

Posted by Mitchell Hudson <mi...@frontgatesolutions.com>.
Sure, I'll repaste the bayes portion, and include the rest of the file 
for good measure. Thanks again!

# SpamAssassin config file for version 3.2x
# Loading SpamAssassin User Preferences From An SQL Database
user_scores_dsn               
DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
user_scores_sql_username      spamassassin
user_scores_sql_password      ***
# Using SpamAssassin Auto-Whitelists With An SQL Database
use_auto_whitelist            1
auto_whitelist_factory        Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn                  
DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
user_awl_sql_username         spamassassin
user_awl_sql_password         ***
user_awl_sql_table            awl

# Using A SQL Database for Bayesian Storage Module
use_bayes                     1
use_bayes_rules               1
bayes_auto_learn              1
bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn                 
DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
bayes_sql_username            spamassassin
bayes_sql_password            ***
bayes_min_ham_num             100
bayes_min_spam_num            100
bayes_learn_during_report     1
bayes_expiry_max_db_size      180000
bayes_auto_expire             0
bayes_journal_max_size        102400
bayes_learn_to_journal        0
bayes_use_hapaxes             1
bayes_sql_override_username  spamassassin

add_header all BayesScore _BAYES_
add_header all TokenSummary _TOKENSUMMARY_
add_header all Bayestc _BAYESTC_
add_header all Bayestcleanred  _BAYESTCLEARNED_
add_header all bayestcspammy _BAYESTCSPAMMY_
add_header all bayestchammy  _BAYESTCHAMMY_
add_header all bayestop5hammytokens  _HAMMYTOKENS(5)_
add_header all bayestop5spammytokens  _SPAMMYTOKENS(5)_
score BODY_ENHANCEMENT 5.0
score BODY_ENHANCEMENT2 5.0
score DRUGS_ERECTILE 20.0
score FB_CIALIS_LEO3 5.0
score FRT_LEVITRA 5.0
score FUZZY_CPILL 5.0
score FUZZY_VPILL 5.0
score SARE_ADULT2 5.0
score SARE_SXLIFE 5.0
score SARE_WEOFFER 5.0
score FB_ADD_INCHES 5.0
#score RCVD_IN_NJABL_DUL 2.9
#score RAZOR2_CF_RANGE_51_100 1.5
score DATE_IN_FUTURE_03_06 3.5
score DATE_IN_FUTURE_06_12 2.5
score  CHARSET_FARAWAY 6.0
score  CHARSET_FARAWAY_HEADER 6.0
# How many hits before a message is considered spam.
required_score  5.00
# Text to prepend to subject if rewrite_subject is used
rewrite_header Subject  [SPAM]
# Encapsulate spam in an attachment
report_safe     0
# Enable or disable network checks
skip_rbl_checks               1
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales                    all
# All cusom directives may be added to 
/hsphere/local/config/mail/spamassassin/custom.cf
include /hsphere/local/config/mail/spamassassin/custom.cf


-- Mitch



Leveau Stanislas wrote:
> Hi
>
> Can you show us your spamassassin configuration : local.cf
>
> Thanks
>
>> Mitchell Hudson schrieb am 19.03.2008 18:18:
>>
>>> I have a few questions though, you said I am not using  
>>> bayes_sql_override_username  but I have  
>>> "bayes_sql_override_username  spamassassin " in my config, does  
>>> that not count?
>>
>> I'm sorry, I overlooked that. Yes, in the configuration that you posted
>> it was set. And I also told rubbish by claiming that you ran under the
>> username root. SA reported the internal userid from the sql table, and
>> that was probably the user 'spamassassin'.
>>
>>> As well I tried setting the min_ham and min_spam to 1 just for a  
>>> short test, and took out the bayes_sql_override_username  and it  
>>> wasn't calling. When I did the use spamassassin; select * from  
>>> bayes_vars; I did get a list of people, but they have very few  
>>> tokens, in the order of 1 or 2 which looks to me like those tokens  
>>> were created when I was tinkering and removed the  
>>> sql_override_username, otherwise everything is put into the  
>>> spamassassin user which has a few hundred thousand tokens in it  
>>> currently.
>>
>> Yes, that's a valid explanation. Sorry for the confusion from my part.
>> But that leads us back to your question: "why it is not scoring?". Did
>> you really found all bayes-related output from --lint? If I run a
>> "spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related
>> output:
>>
>> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from @INC
>> [21631] dbg: config: fixed relative path:
>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>> [21631] dbg: config: using
>> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
>> for included file
>> [21631] dbg: config: read file
>> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
>> [21631] dbg: bayes: using username: mail
>> [21631] dbg: bayes: database connection established
>> [21631] dbg: bayes: found bayes db version 3
>> [21631] dbg: bayes: Using userid: 2
>> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
>> [21631] dbg: bayes: tok_get_all: token count: 21
>> [21631] dbg: bayes: score = 0.0020110638266459
>> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size:
>> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
>> expire: 1205444421, Current time: 1205950517
>> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
>> [21631] dbg: check:
>> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS 
>>
>>
>> I am using Mysql as database.
>>
>> Tschau
>> Alex
>
>
>



Re: Bayes not running but no errors

Posted by Alex Woick <al...@wombaz.de>.
Leveau Stanislas schrieb am 19.03.2008 19:39:

> Can you show us your spamassassin configuration : local.cf

My configuration is working very well, and it is this:
(running under Fedora 7, with a remote Windows MySql 5.0.37 server).

whitelist_bounce_relays lxrouter.wombaz.localnet *.prima.de

trusted_networks 10/8 192.168/16 83.97.48/24 172.16.0.0/12

report_safe 0
allow_user_rules 0

use_bayes 1
bayes_expiry_max_db_size 500000

dns_available yes

use_dcc 1
dcc_timeout 20
dcc_home /var/dcc
dcc_path /usr/local/bin

use_pyzor 1
pyzor_timeout 20
pyzor_options --homedir /etc/pyzor
pyzor_path /usr/bin/pyzor

use_razor2 1
razor_timeout 20
razor_config /etc/razor/razor-agent.conf

rbl_timeout 15

lock_method flock

use_auto_whitelist 1
user_awl_sql_override_username mail
auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn                 DBI:mysql:sa:dc1.wombaz.localnet
user_awl_sql_username        sa
user_awl_sql_password        ***
user_awl_sql_table           awl

bayes_sql_override_username mail
bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
bayes_sql_dsn      DBI:mysql:sa:dc1.wombaz.localnet
bayes_sql_username sa
bayes_sql_password ***

bayes_ignore_header X-Account-Key
bayes_ignore_header X-UIDL
bayes_ignore_header X-Mozilla-Status
bayes_ignore_header X-Mozilla-Status2
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status

whitelist_from logwatch@wombaz.de

ok_locales en
ok_languages en de fr it la nl

score BAYES_99 4.5

Re: Bayes not running but no errors

Posted by Leveau Stanislas <st...@ac-caen.fr>.
Hi

Can you show us your spamassassin configuration : local.cf

Thanks

> Mitchell Hudson schrieb am 19.03.2008 18:18:
>
>> I have a few questions though, you said I am not using   
>> bayes_sql_override_username  but I have   
>> "bayes_sql_override_username  spamassassin " in my config, does   
>> that not count?
>
> I'm sorry, I overlooked that. Yes, in the configuration that you posted
> it was set. And I also told rubbish by claiming that you ran under the
> username root. SA reported the internal userid from the sql table, and
> that was probably the user 'spamassassin'.
>
>> As well I tried setting the min_ham and min_spam to 1 just for a   
>> short test, and took out the bayes_sql_override_username  and it   
>> wasn't calling. When I did the use spamassassin; select * from   
>> bayes_vars; I did get a list of people, but they have very few   
>> tokens, in the order of 1 or 2 which looks to me like those tokens   
>> were created when I was tinkering and removed the   
>> sql_override_username, otherwise everything is put into the   
>> spamassassin user which has a few hundred thousand tokens in it   
>> currently.
>
> Yes, that's a valid explanation. Sorry for the confusion from my part.
> But that leads us back to your question: "why it is not scoring?". Did
> you really found all bayes-related output from --lint? If I run a
> "spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related
> output:
>
> [21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from @INC
> [21631] dbg: config: fixed relative path:
> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
> [21631] dbg: config: using
> "/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf"
> for included file
> [21631] dbg: config: read file
> /var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
> [21631] dbg: bayes: using username: mail
> [21631] dbg: bayes: database connection established
> [21631] dbg: bayes: found bayes db version 3
> [21631] dbg: bayes: Using userid: 2
> [21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
> [21631] dbg: bayes: tok_get_all: token count: 21
> [21631] dbg: bayes: score = 0.0020110638266459
> [21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size:
> 500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last
> expire: 1205444421, Current time: 1205950517
> [21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
> [21631] dbg: check:
> tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS
>
> I am using Mysql as database.
>
> Tschau
> Alex




Re: Bayes not running but no errors

Posted by Alex Woick <al...@wombaz.de>.
Mitchell Hudson schrieb am 19.03.2008 18:18:

> I have a few questions though, you said I am not using 
> bayes_sql_override_username  but I have "bayes_sql_override_username  
> spamassassin " in my config, does that not count?

I'm sorry, I overlooked that. Yes, in the configuration that you posted 
it was set. And I also told rubbish by claiming that you ran under the 
username root. SA reported the internal userid from the sql table, and 
that was probably the user 'spamassassin'.

> As well I tried 
> setting the min_ham and min_spam to 1 just for a short test, and took 
> out the bayes_sql_override_username  and it wasn't calling. When I did 
> the use spamassassin; select * from bayes_vars; I did get a list of 
> people, but they have very few tokens, in the order of 1 or 2 which 
> looks to me like those tokens were created when I was tinkering and 
> removed the sql_override_username, otherwise everything is put into the 
> spamassassin user which has a few hundred thousand tokens in it currently.

Yes, that's a valid explanation. Sorry for the confusion from my part. 
But that leads us back to your question: "why it is not scoring?". Did 
you really found all bayes-related output from --lint? If I run a 
"spamassassin --lint -D 2>&1|grep -i bayes", I get more bayes-related 
output:

[21631] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from @INC
[21631] dbg: config: fixed relative path: 
/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
[21631] dbg: config: using 
"/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf" 
for included file
[21631] dbg: config: read file 
/var/lib/spamassassin/3.002004/updates_spamassassin_org/23_bayes.cf
[21631] dbg: bayes: using username: mail
[21631] dbg: bayes: database connection established
[21631] dbg: bayes: found bayes db version 3
[21631] dbg: bayes: Using userid: 2
[21631] dbg: bayes: corpus size: nspam = 214240, nham = 138319
[21631] dbg: bayes: tok_get_all: token count: 21
[21631] dbg: bayes: score = 0.0020110638266459
[21631] dbg: bayes: DB expiry: tokens in DB: 461680, Expiry max size: 
500000, Oldest atime: 1203126859, Newest atime: 1205950517, Last expire: 
1205444421, Current time: 1205950517
[21631] dbg: rules: ran eval rule BAYES_00 ======> got hit (1)
[21631] dbg: check: 
tests=BAYES_00,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS

I am using Mysql as database.

Tschau
Alex

Re: Bayes not running but no errors

Posted by Mitchell Hudson <mi...@frontgatesolutions.com>.
Thank you so much for the help.

 I have a few questions though, you said I am not using 
bayes_sql_override_username  but I have "bayes_sql_override_username  
spamassassin " in my config, does that not count? As well I tried 
setting the min_ham and min_spam to 1 just for a short test, and took 
out the bayes_sql_override_username  and it wasn't calling. When I did 
the use spamassassin; select * from bayes_vars; I did get a list of 
people, but they have very few tokens, in the order of 1 or 2 which 
looks to me like those tokens were created when I was tinkering and 
removed the sql_override_username, otherwise everything is put into the 
spamassassin user which has a few hundred thousand tokens in it currently.

Thanks again

--Mitch

Alex Woick wrote:
> Mitchell Hudson schrieb am 18.03.2008 23:59:
>
>> Simply it's not scoring, it leanrs, but doesn't put a score on any mail.
>
>> #spamassassin -D --lint
>> [23822] dbg: bayes: using username: spamassassin
>> [23822] dbg: bayes: database connection established
>> [23822] dbg: bayes: found bayes db version 3
>> [23822] dbg: bayes: Using userid: 1
>
> You are running this lint test as userid 1, that means as user root. 
> This is not neccessarily the same user other spam/ham was learned with.
>
>> #From local.cf:
>> use_bayes                     1
>> use_bayes_rules               1
>> bayes_auto_learn              1
>> bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
>> bayes_sql_dsn                 
>> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
>> bayes_sql_username            spamassassin
>> bayes_sql_password            ***
>> bayes_min_ham_num             100
>> bayes_min_spam_num            100
>> bayes_learn_during_report     1
>> bayes_expiry_max_db_size      180000
>> bayes_auto_expire             0
>> bayes_journal_max_size        102400
>> bayes_learn_to_journal        0
>> bayes_use_hapaxes             1
>> bayes_sql_override_username  spamassassin
>
> You are NOT using bayes_sql_override_username <username>, that means 
> you are using a per-user bayes filter. You probably call spamc with -u 
> <username>, so every <username> has its own set of tokens learned. 
> Each user has to fulfill individually the minimum ham/spam mails learned.
>
> To see which users have a bayes data set and how many spam/ham is 
> learned for each of them, use this sql statement in a mysql client of 
> your choice: SELECT * FROM bayes_vars
>
> If you want to use a site-wide bayes database, use one global username 
> with bayes_sql_override_username.
>
> Tschau
> Alex

-- 
--
Mitchell Hudson
Systems Administrator
Front Gate Solutions
1711 S Congress Ave
Austin, TX 78704
P: 512-674-9337
C: 512-587-0918
F: 512-499-0440
Mitchell@FrontGateSolutions.com



Re: Bayes not running but no errors

Posted by Alex Woick <al...@wombaz.de>.
Mitchell Hudson schrieb am 18.03.2008 23:59:

> Simply it's not scoring, it leanrs, but doesn't put a score on any mail.

> #spamassassin -D --lint
> [23822] dbg: bayes: using username: spamassassin
> [23822] dbg: bayes: database connection established
> [23822] dbg: bayes: found bayes db version 3
> [23822] dbg: bayes: Using userid: 1

You are running this lint test as userid 1, that means as user root. 
This is not neccessarily the same user other spam/ham was learned with.

> #From local.cf:
> use_bayes                     1
> use_bayes_rules               1
> bayes_auto_learn              1
> bayes_store_module            Mail::SpamAssassin::BayesStore::SQL
> bayes_sql_dsn                 
> DBI:mysql:spamassassin:mysql_socket=/var/lib/mysql/mysql.sock
> bayes_sql_username            spamassassin
> bayes_sql_password            ***
> bayes_min_ham_num             100
> bayes_min_spam_num            100
> bayes_learn_during_report     1
> bayes_expiry_max_db_size      180000
> bayes_auto_expire             0
> bayes_journal_max_size        102400
> bayes_learn_to_journal        0
> bayes_use_hapaxes             1
> bayes_sql_override_username  spamassassin

You are NOT using bayes_sql_override_username <username>, that means you 
are using a per-user bayes filter. You probably call spamc with -u 
<username>, so every <username> has its own set of tokens learned. Each 
user has to fulfill individually the minimum ham/spam mails learned.

To see which users have a bayes data set and how many spam/ham is 
learned for each of them, use this sql statement in a mysql client of 
your choice: SELECT * FROM bayes_vars

If you want to use a site-wide bayes database, use one global username 
with bayes_sql_override_username.

Tschau
Alex