[Maia-users] (Update) / HOW TO: Delete High Score SPAM (amavis $sa_quarantine_cutoff_level fix)
Sebastian A. Aresca
saresca at westusa.com
Mon Jul 30 17:42:54 PDT 2007
Add the first line to the script:
mysql -v -D maia -u root -B -e "DELETE FROM maia_mail_recipients WHERE mail_id NOT IN (SELECT id FROM maia_mail);"
This is because I checked that while the script is deleting the maia_mail_recipients table other records are coming to mail_mail.
This new line will delete the LOST PARENT records from maia_mail_recipients.
###################################################################################################################################
#!/bin/bash
echo -n "Deleting records ... "
mysql -v -D maia -u root -B -e "DELETE FROM maia_mail_recipients WHERE mail_id NOT IN (SELECT id FROM maia_mail);" ## TO ADD
mysql -v -D maia -u root -B -e "DELETE FROM maia_mail_recipients WHERE mail_id IN (SELECT * FROM HighScore)"
mysql -v -D maia -u root -B -e "DELETE FROM maia_sa_rules_triggered WHERE mail_id IN (SELECT * FROM HighScore)"
mysql -v -D maia -u root -B -e "DELETE FROM maia_viruses_detected WHERE mail_id IN (SELECT * FROM HighScore)"
mysql -v -D maia -u root -B -e "DELETE FROM maia_banned_attachments_found WHERE mail_id IN (SELECT * FROM HighScore)"
mysql -v -D maia -u root -B -e "DELETE FROM maia_mail WHERE score > 20"
echo "OK"
###################################################################################################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.renaissoft.com/pipermail/maia-users/attachments/20070730/f6a984c4/attachment.html
More information about the Maia-users
mailing list