RE: mySQL bayes not working correctly

2007-06-10 Thread Gary V

I'm running amavisd-new with spamassassin and setup bayes and mysql earlier
today. It seems to connect to the db fine with user vscan when running
spamassassin -d. I ran sa-learn --spam/ham  spam.txt (full email headers
too) a few times and those are the only entires in the db, the ones that I
added, all other email is untouched. What's the deal? Here is my local.cf
file... awl seems to work fine, but it scores mail funky sometimes.

# Enable the Bayes system
use_bayes 1
bayes_store_moduleMail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn DBI:mysql:bayes
bayes_sql_usernamevscan
bayes_sql_passwordvscan
bayes_sql_override_username   vscan

# Enable awl
auto_whitelist_factoryMail::SpamAssassin::SQLBasedAddrList
user_awl_dsn  DBI:mysql:bayes
user_awl_sql_username vscan
user_awl_sql_password vscan

--


You probably ran the commands as root, so you are only looking at root's 
data. Add this in local.cf:


bayes_sql_override_username vscan

That way everyone will see the same data (site wide configuration). You want 
to always run spamassassin and sa-learn commands as the vscan user but 
adding this seting means that even if you learn spam or ham as root, vscan's 
data will be updated.


su vscan -c 'sa-learn --spam  spam.txt'

Gary V

_
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows 
Live Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-usocid=TXT_TAGHM_migration_HM_mini_pcmag_0507




Re: mySQL bayes not working correctly

2007-06-10 Thread Steven Stern
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Gary V wrote:
 I'm running amavisd-new with spamassassin and setup bayes and mysql
 earlier
 today. It seems to connect to the db fine with user vscan when running
 spamassassin -d. I ran sa-learn --spam/ham  spam.txt (full email headers
 too) a few times and those are the only entires in the db, the ones
 that I
 added, all other email is untouched. What's the deal? Here is my local.cf
 file... awl seems to work fine, but it scores mail funky sometimes.

 # Enable the Bayes system
 use_bayes 1
 bayes_store_moduleMail::SpamAssassin::BayesStore::SQL
 bayes_sql_dsn DBI:mysql:bayes
 bayes_sql_usernamevscan
 bayes_sql_passwordvscan
 bayes_sql_override_username   vscan

 # Enable awl
 auto_whitelist_factoryMail::SpamAssassin::SQLBasedAddrList
 user_awl_dsn  DBI:mysql:bayes
 user_awl_sql_username vscan
 user_awl_sql_password vscan

 -- 
 
 You probably ran the commands as root, so you are only looking at root's
 data. Add this in local.cf:
 
 bayes_sql_override_username vscan
 
 That way everyone will see the same data (site wide configuration). You
 want to always run spamassassin and sa-learn commands as the vscan user
 but adding this seting means that even if you learn spam or ham as root,
 vscan's data will be updated.
 
 su vscan -c 'sa-learn --spam  spam.txt'
 
 Gary V


As for the funky AWL values, you need to do some AWL expiry.

Add a field to the AWL table that shows the last time that address got hit:
  ALTER TABLE awl ADD lastupdate timestamp(14) NOT NULL;
  UPDATE awl SET lastupdate = NOW( ) WHERE lastupdate  1;

Then set up a script to clean up awl entries:

  /usr/bin/mysql -usa_user -psa_user_psw  /usr/local/bin/trim-awl.sql

  USE sa_bayes;
  DELETE FROM awl WHERE lastupdate = DATE_SUB(SYSDATE(), INTERVAL 2 MONTH);
  DELETE FROM awl WHERE count = 1 AND lastupdate = DATE_SUB(SYSDATE(),
   INTERVAL 15 DAY);

(reference: http://www200.pair.com/mecham/spam/fc4-spamassassin-sql.html)
- --

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

iD4DBQFGbBlSeERILVgMyvARAuQ4AJjmzxS8+XmQwclH1/2alQlx+slUAJ9m/EpM
M+0aSAR00llWR5ROGdp/kw==
=H68i
-END PGP SIGNATURE-


RE: mySQL bayes not working correctly

2007-06-10 Thread Peter Pluta


Gary V-2 wrote:
 
I'm running amavisd-new with spamassassin and setup bayes and mysql
earlier
today. It seems to connect to the db fine with user vscan when running
spamassassin -d. I ran sa-learn --spam/ham  spam.txt (full email headers
too) a few times and those are the only entires in the db, the ones that I
added, all other email is untouched. What's the deal? Here is my local.cf
file... awl seems to work fine, but it scores mail funky sometimes.

# Enable the Bayes system
use_bayes 1
bayes_store_moduleMail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn DBI:mysql:bayes
bayes_sql_usernamevscan
bayes_sql_passwordvscan
bayes_sql_override_username   vscan

# Enable awl
auto_whitelist_factoryMail::SpamAssassin::SQLBasedAddrList
user_awl_dsn  DBI:mysql:bayes
user_awl_sql_username vscan
user_awl_sql_password vscan

--
 
 You probably ran the commands as root, so you are only looking at root's 
 data. Add this in local.cf:
 
 bayes_sql_override_username vscan
 
 That way everyone will see the same data (site wide configuration). You
 want 
 to always run spamassassin and sa-learn commands as the vscan user but 
 adding this seting means that even if you learn spam or ham as root,
 vscan's 
 data will be updated.
 
 su vscan -c 'sa-learn --spam  spam.txt'
 
 Gary V
 
 _
 PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows 
 Live Hotmail. 
 http://imagine-windowslive.com/hotmail/?locale=en-usocid=TXT_TAGHM_migration_HM_mini_pcmag_0507
 
 
 

The command was run as user vscan (amavisd-new user and spamassassin user).
If you look closer you will see that my config already has that directive. 

-- 
View this message in context: 
http://www.nabble.com/mySQL-bayes-not-working-correctly-tf3896467.html#a11049679
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



RE: mySQL bayes not working correctly

2007-06-10 Thread Gary V

Gary V-2 wrote:

I'm running amavisd-new with spamassassin and setup bayes and mysql
earlier
today. It seems to connect to the db fine with user vscan when running
spamassassin -d. I ran sa-learn --spam/ham  spam.txt (full email 
headers
too) a few times and those are the only entires in the db, the ones that 
I
added, all other email is untouched. What's the deal? Here is my 
local.cf

file... awl seems to work fine, but it scores mail funky sometimes.

# Enable the Bayes system
use_bayes 1
bayes_store_moduleMail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn DBI:mysql:bayes
bayes_sql_usernamevscan
bayes_sql_passwordvscan
bayes_sql_override_username   vscan

# Enable awl
auto_whitelist_factoryMail::SpamAssassin::SQLBasedAddrList
user_awl_dsn  DBI:mysql:bayes
user_awl_sql_username vscan
user_awl_sql_password vscan

--

 You probably ran the commands as root, so you are only looking at root's
 data. Add this in local.cf:

 bayes_sql_override_username vscan

 That way everyone will see the same data (site wide configuration). You
 want
 to always run spamassassin and sa-learn commands as the vscan user but
 adding this seting means that even if you learn spam or ham as root,
 vscan's
 data will be updated.

 su vscan -c 'sa-learn --spam  spam.txt'

 Gary V




The command was run as user vscan (amavisd-new user and spamassassin user).
If you look closer you will see that my config already has that directive.



Indeed, I missed it.

Not related, but if running MySQL 4.1 or newer, change:
Mail::SpamAssassin::BayesStore::SQL
to
Mail::SpamAssassin::BayesStore::MySQL

I would run
amavisd stop
amavisd -d bayes debug-sa

then send a message containing the gtube string through it. Send the message 
from the outside world (smtp), not from the local machine. See what 
amavisd-new thinks of Bayes.


Gary V

_
Get a preview of Live Earth, the hottest event this summer - only on MSN 
http://liveearth.msn.com?source=msntaglineliveearthhm




RE: mySQL bayes not working correctly

2007-06-10 Thread Peter Pluta



Gary V-2 wrote:
 
Gary V-2 wrote:
 
 I'm running amavisd-new with spamassassin and setup bayes and mysql
earlier
 today. It seems to connect to the db fine with user vscan when running
 spamassassin -d. I ran sa-learn --spam/ham  spam.txt (full email 
headers
 too) a few times and those are the only entires in the db, the ones
 that 
I
 added, all other email is untouched. What's the deal? Here is my 
local.cf
 file... awl seems to work fine, but it scores mail funky sometimes.
 
 # Enable the Bayes system
 use_bayes 1
 bayes_store_moduleMail::SpamAssassin::BayesStore::SQL
 bayes_sql_dsn DBI:mysql:bayes
 bayes_sql_usernamevscan
 bayes_sql_passwordvscan
 bayes_sql_override_username   vscan
 
 # Enable awl
 auto_whitelist_factoryMail::SpamAssassin::SQLBasedAddrList
 user_awl_dsn  DBI:mysql:bayes
 user_awl_sql_username vscan
 user_awl_sql_password vscan
 
 --
 
  You probably ran the commands as root, so you are only looking at
 root's
  data. Add this in local.cf:
 
  bayes_sql_override_username vscan
 
  That way everyone will see the same data (site wide configuration). You
  want
  to always run spamassassin and sa-learn commands as the vscan user but
  adding this seting means that even if you learn spam or ham as root,
  vscan's
  data will be updated.
 
  su vscan -c 'sa-learn --spam  spam.txt'
 
  Gary V

 
The command was run as user vscan (amavisd-new user and spamassassin
user).
If you look closer you will see that my config already has that directive.

 
 Indeed, I missed it.
 
 Not related, but if running MySQL 4.1 or newer, change:
 Mail::SpamAssassin::BayesStore::SQL
 to
 Mail::SpamAssassin::BayesStore::MySQL
 
 I would run
 amavisd stop
 amavisd -d bayes debug-sa
 
 then send a message containing the gtube string through it. Send the
 message 
 from the outside world (smtp), not from the local machine. See what 
 amavisd-new thinks of Bayes.
 
 Gary V
 
 _
 Get a preview of Live Earth, the hottest event this summer - only on MSN 
 http://liveearth.msn.com?source=msntaglineliveearthhm
 
 
 

I will try that, what exactly is the gtube string?
-- 
View this message in context: 
http://www.nabble.com/mySQL-bayes-not-working-correctly-tf3896467.html#a11049840
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



Re: mySQL bayes not working correctly

2007-06-10 Thread Peter Pluta


Steven Stern wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Gary V wrote:
 I'm running amavisd-new with spamassassin and setup bayes and mysql
 earlier
 today. It seems to connect to the db fine with user vscan when running
 spamassassin -d. I ran sa-learn --spam/ham  spam.txt (full email
 headers
 too) a few times and those are the only entires in the db, the ones
 that I
 added, all other email is untouched. What's the deal? Here is my
 local.cf
 file... awl seems to work fine, but it scores mail funky sometimes.

 # Enable the Bayes system
 use_bayes 1
 bayes_store_moduleMail::SpamAssassin::BayesStore::SQL
 bayes_sql_dsn DBI:mysql:bayes
 bayes_sql_usernamevscan
 bayes_sql_passwordvscan
 bayes_sql_override_username   vscan

 # Enable awl
 auto_whitelist_factoryMail::SpamAssassin::SQLBasedAddrList
 user_awl_dsn  DBI:mysql:bayes
 user_awl_sql_username vscan
 user_awl_sql_password vscan

 -- 
 
 You probably ran the commands as root, so you are only looking at root's
 data. Add this in local.cf:
 
 bayes_sql_override_username vscan
 
 That way everyone will see the same data (site wide configuration). You
 want to always run spamassassin and sa-learn commands as the vscan user
 but adding this seting means that even if you learn spam or ham as root,
 vscan's data will be updated.
 
 su vscan -c 'sa-learn --spam  spam.txt'
 
 Gary V
 
 
 As for the funky AWL values, you need to do some AWL expiry.
 
 Add a field to the AWL table that shows the last time that address got
 hit:
   ALTER TABLE awl ADD lastupdate timestamp(14) NOT NULL;
   UPDATE awl SET lastupdate = NOW( ) WHERE lastupdate  1;
 
 Then set up a script to clean up awl entries:
 
   /usr/bin/mysql -usa_user -psa_user_psw  /usr/local/bin/trim-awl.sql
 
   USE sa_bayes;
   DELETE FROM awl WHERE lastupdate = DATE_SUB(SYSDATE(), INTERVAL 2
 MONTH);
   DELETE FROM awl WHERE count = 1 AND lastupdate = DATE_SUB(SYSDATE(),
INTERVAL 15 DAY);
 
 (reference: http://www200.pair.com/mecham/spam/fc4-spamassassin-sql.html)
 - --
 
   Steve
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD4DBQFGbBlSeERILVgMyvARAuQ4AJjmzxS8+XmQwclH1/2alQlx+slUAJ9m/EpM
 M+0aSAR00llWR5ROGdp/kw==
 =H68i
 -END PGP SIGNATURE-
 
 

I see, I will take a look. I figured spamassassin did all the work for me,
guess not. 
-- 
View this message in context: 
http://www.nabble.com/mySQL-bayes-not-working-correctly-tf3896467.html#a11049848
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.



RE: mySQL bayes not working correctly

2007-06-10 Thread Gary V

 I would run
 amavisd stop
 amavisd -d bayes debug-sa

 then send a message containing the gtube string through it. Send the
 message
 from the outside world (smtp), not from the local machine. See what
 amavisd-new thinks of Bayes.




I will try that, what exactly is the gtube string?


This is the first link Goole produced:

http://spamassassin.apache.org/gtube/

_
Get a preview of Live Earth, the hottest event this summer - only on MSN 
http://liveearth.msn.com?source=msntaglineliveearthhm