Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - SQL command
  FAQ FAQ  Forum Search   Register Register  Login Login

SQL command

 Post Reply Post Reply
Author
ssullivan View Drop Down
Newbie
Newbie


Joined: 02 February 2006
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote ssullivan Quote  Post ReplyReply Direct Link To This Post Topic: SQL command
    Posted: 02 February 2006 at 3:43pm

In my SpamFilter I have it set to delete and email older than 14 days from the quarantine db, but there appears to be messages all the way back to 2004 in the database.  Which table in SQL will need to be deleted to reduce this size?

 

Shane

Back to Top
LogSat View Drop Down
Admin Group
Admin Group
Avatar

Joined: 25 January 2005
Location: United States
Status: Offline
Points: 4106
Post Options Post Options   Thanks (0) Thanks(0)   Quote LogSat Quote  Post ReplyReply Direct Link To This Post Posted: 02 February 2006 at 5:02pm
Shane,

If SpamFilter was moved to a different server it is possible that some emails will remain in the quarantine database. This is because SpamFilter supports multiple SpamFilter servers connecting to the same database. To do this, each server keeps track of the emails it quarantined. If you move SpamFilter to a new server, the old entries will be orphaned.

You can issue SQL commands to manually delete older emails. First mark old emails for deletion with the following:

UPDATE    tblQuarantine
SET         &nb sp;    Expire = 1
WHERE     (MsgDate < '2/1/2006')

The date syntax will depend on your DB platform. For Microsoft SQL for example it's:

UPDATE    tblQuarantine
SET         &nb sp;    Expire = 1
WHERE     (MsgDate < CONVERT(DATETIME, '2001-01-01 00:00:00', 102))


Once the older emails have been tagged for deletion, issue the following command to delete them:

DELETE tblMsgs
FROM         tblMsgs INNER JOIN
                        tblQuarantine ON tblMsgs.MsgID = tblQuarantine.MsgID
WHERE     tblQuarantine.Expire <> 0



Roberto Franceschetti

LogSat Software

Spam Filter ISP
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.271 seconds.