When deleteing messages from the database, its best to stop the threads linked to the message.
Useful switches for selecting the correct message are:
-d dest = select messages with specified destination
-f source = select messages with specified source
Note that a resend on an outbound thread will have that thread as the source!
When we were on a less poweful server (Unix) I ran a script once a week in test that deleted queued messages older than one week. This was about 6 years ago and I can’t find the script now (we’ve upgraded hardware twice!)
A useful trick (on Unix) for getting dates for a few days ago is to use the timezone
eg
[5.4] he00387> echo “Now ” `TZ=0; date`
Now Wed Jul 4 03:32:16 2007
[5.4] he00387> echo “and then ” `TZ=+48;date`
and then Mon Jul 2 03:32:22 2007