List Info

Thread: delete emails from maia_mail




delete emails from maia_mail
user name
2006-08-30 19:00:20
I am trying to solve some slowdowns on my server that
started about  
two weeks ago.  First I thought it was the bayes db, because
it was  
about 7gigs.  After pruning it didnt do much, I dropped it. 
Still no  
change, emails are taking from 6000ms to 20000ms to get
through  
amavis.   (seems to be about half the time in SA tests and
half in  
maia_record_tests)

So I started looking at the database again. I have one
domain with  
the default domain.com user that has 96946 messages.  So I would 

like to get those removed to see if that helps clean up the
db a  
bit.   Suggestions on how to do that on mysql ?

I have the maia_user_id for the domain.com user, next I
need to get  
a list of all the emails using select mail_id from  
maia_mail_recipients where recipient_id = "124"
then just delete  
those msgs from maia_mail, anything else I need to delete? 
Will the  
process script clean up the entries from
maia_mail_recipients if the  
messages are missing?


_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users
delete emails from maia_mail
user name
2006-08-30 20:53:40
Cameron Slye wrote:
> I am trying to solve some slowdowns on my server that
started about  
> two weeks ago.  First I thought it was the bayes db,
because it was  
> about 7gigs.  After pruning it didnt do much, I dropped
it.  Still no  
> change, emails are taking from 6000ms to 20000ms to get
through  
> amavis.   (seems to be about half the time in SA tests
and half in  
> maia_record_tests)
> 
> So I started looking at the database again. I have one
domain with  
> the default domain.com user that has 96946 messages. 
So I would  
> like to get those removed to see if that helps clean up
the db a  
> bit.   Suggestions on how to do that on mysql ?

Don't try deleting mail items manually from the database;
there are a
number of other tables that reference the maia_mail table,
and you risk
introducing inconsistencies if you don't manage these
references properly.

The "proper" way to do what you're after is to
use the
expire-quarantine-cache.pl script.  First, go to your
Admin->System
Configuration page and reduce the expiry periods for spam
and non-spam
to a very low figure--say, 1 or 2 days.  Then run
expire-quarantine-cache.pl, and any (unconfirmed) mail items
older than
those limits will be deleted.  If you also want to delete
confirmed
items at the same time, add the --confirmed-spam and
--confirmed-nonspam
arguments.

In general, you want to keep your expiry periods fairly
short if you've
got significant mail traffic.  The defaults of 30 days for
spam and 7
days for non-spam aren't really appropriate for a
high-traffic
site--you'd do better with 7 for spam and 3 for nonspam,
most likely.
These expiry periods effectively limit the size of your
database,
keeping it from growing to the massive levels you're
currently seeing.
Running the expire-quarantine-cache.pl script once a day is,
of course,
necessary to enforce these limits.

-- 
Robert LeBlanc <rjlrenaissoft.com>
Renaissoft, Inc.
Maia Mailguard <http://www.maiamail
guard.com/>

_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )