Re: purge byes in sql

2008-04-02 Thread Ken Menzel
Hi Miguel, 
I run /usr/local/bin/sa-learn --force-expire daily with MySQL and it 
works fine.


Here is an excellent slide show on use SQL with SA: 
http://people.apache.org/~parker/presentations/MO13slides.pdf


You may also find these SQL queries helpful,  I run them monthly.

echo "Starting Monthly AWl purge - "
echo "Delete AWL entries older than 4 months";

$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as 4MonthOld FROM awl WHERE lastupdate <= 
DATE_SUB(SYSDATE(), I

NTERVAL 4 MONTH);" \
$DB

$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM awl WHERE lastupdate <= DATE_SUB(SYSDATE(), INTERVAL 4 
MONTH);" \

$DB

echo "Delete AWL entries with only a single e-mail over 30 days old"

$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as 30DayOldSingles FROM awl WHERE count = 1 AND 
lastupdate <= D

ATE_SUB(SYSDATE(), INTERVAL 30 DAY);" \
$DB

$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM awl WHERE count = 1 AND lastupdate <= DATE_SUB(SYSDATE(), 
INTERVAL

30 DAY);" \
$DB

echo "Check for insignigcant scoring AWL entries"
$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as Insignificant FROM awl WHERE totscore/count < .1 AND 
totscor

e/count > .1;" \
$DB

$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM awl WHERE totscore/count < .1 AND totscore/count > .1;" \
$DB

$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as TotalBayesSeen FROM bayes_seen;" \
$DB

echo "Delete bayes seen older than 1 month"

$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as 1MonthOldBayesSeen FROM bayes_seen WHERE lastupdate 
<= DATE_

SUB(SYSDATE(), INTERVAL 1 MONTH);" \
$DB

$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM bayes_seen WHERE lastupdate <= DATE_SUB(SYSDATE(), INTERVAL 
1 MONTH

); " \
$DB



Miguel wrote:
Hi, does SA takes care of purging old bayesian records stored in mysql 
similar what it does to the traditional DB files?

If not, what is the recommended procedure to do so?
regards



Re: spam and virus

2007-09-14 Thread Ken Menzel

From: "Dean Clapper" <[EMAIL PROTECTED]>
Sent: Friday, September 14, 2007 9:38 AM
Is there a configuration for spamassassin to catch virus 
attachments?   Or,

does any one know of one to run on a server with sendmail?

I use mimedefang http://www.mimedefang.org/ with sendmail,clamav and 
SA.  Great flexibility.  Lots of mimedefang recipes on the wiki page.


Ken 



Re: Bayes db size....

2007-02-19 Thread Ken Menzel
- Original Message - 
From: "Dave Koontz" <[EMAIL PROTECTED]>

To: "'spam mailling list'" 
Sent: Saturday, February 17, 2007 9:30 AM
Subject: Re: Bayes db size



Is there a consensus on this need?  I deal with the seen db issue by
scheduled deletion of that file.  That said,  with SA becoming more 
and
more prominent all the time, I suspect the Average Joe will miss 
this
oddity until they wind up with a sluggish system, out of drive space 
or

other related issues.

I was mostly curious of the logic on NOT doing maintenance on the 
Seen

and AWL db files.  If there is a consensus this needs to occur, then
perhaps I can take the time to create a proper patch.  I just want 
to

make sure I am not missing something fundamental here

Michael Parker wrote:

Dave Koontz wrote:



I use the SQL interface and expire the bayes_seen like this.  I 
believe 6 months to be over conservative.  I added a lastupdate column 
as a timestamp.  In the perl DBM  I would recommend you use a 
technique such as this and update the timestamp in perl.  It converts 
nicely to SQL.


Here is my query for cleaning bayes_seen:

mysql -u$USER -p$PW -h$SERVER -e\
"DELETE FROM bayes_seen WHERE lastupdate <= DATE_SUB(SYSDATE(), 
INTERVAL 6 MONTH); " \

$DB

Hope this helps,
Ken