You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Tim Bishop <ti...@bishnet.net> on 2005/05/10 18:36:53 UTC

Cleaning up bayes SQL tables

I've been running with bayes in a MySQL database for a while now, and I
need to start dealing with cleaning up users who are no longer here. I
also have AWL and configuration in the database.

So, I think I'm looking at something like the following to delete
someone's data from the database:

1. Delete all entries in spamassassin.awl where the username is the user
   I want to get delete.
2. Delete all entries in spamassassin.userpref where the username is the
   user I want to delete.

3. Delete all the entries in bayes_expire, bayes_seen, and bayes_token
   where the id matches the id field in bayes_vars for the username.
4. Delete the entry in bayes_vars for the username.

So, I have two questions.

Is that all I need to do?
Is it safe to do it - will spamassassin care that entries have vanished?

Thanks,
Tim.


Re: Cleaning up bayes SQL tables

Posted by Arvinn Løkkebakken <ar...@whitebird.no>.

Michael Parker wrote:

>On Tue, May 10, 2005 at 05:36:53PM +0100, Tim Bishop wrote:
>  
>
>>I've been running with bayes in a MySQL database for a while now, and I
>>need to start dealing with cleaning up users who are no longer here. I
>>also have AWL and configuration in the database.
>>
>>So, I think I'm looking at something like the following to delete
>>someone's data from the database:
>>
>>1. Delete all entries in spamassassin.awl where the username is the user
>>   I want to get delete.
>>2. Delete all entries in spamassassin.userpref where the username is the
>>   user I want to delete.
>>    
>>
>
>Yeah, this is pretty much the best way to do this right now.
>  
>

>>3. Delete all the entries in bayes_expire, bayes_seen, and bayes_token
>>   where the id matches the id field in bayes_vars for the username.
>>4. Delete the entry in bayes_vars for the username.
>>    
>>
>
>Best way to do this is with sa-learn:
>sa-learn -u <username you want to remove> --clear
>
>  
>
Why is that?

While on the subject, what about sa-learn --backup vs. mysqldump for 
backups?

And then, while at bayes in SQL, does bayes_seen and bayes_expire grow 
forever? What exactly are those table used for?

Arvinn

Re: Cleaning up bayes SQL tables

Posted by Michael Parker <pa...@pobox.com>.
On Tue, May 10, 2005 at 05:36:53PM +0100, Tim Bishop wrote:
> I've been running with bayes in a MySQL database for a while now, and I
> need to start dealing with cleaning up users who are no longer here. I
> also have AWL and configuration in the database.
> 
> So, I think I'm looking at something like the following to delete
> someone's data from the database:
> 
> 1. Delete all entries in spamassassin.awl where the username is the user
>    I want to get delete.
> 2. Delete all entries in spamassassin.userpref where the username is the
>    user I want to delete.

Yeah, this is pretty much the best way to do this right now.

> 3. Delete all the entries in bayes_expire, bayes_seen, and bayes_token
>    where the id matches the id field in bayes_vars for the username.
> 4. Delete the entry in bayes_vars for the username.

Best way to do this is with sa-learn:
sa-learn -u <username you want to remove> --clear

> So, I have two questions.
> 
> Is that all I need to do?

Should be.

> Is it safe to do it - will spamassassin care that entries have vanished?

Should be ok, if anything else comes in to process for that user then
the AWL and Bayes entries will just be recreated.

Michael