This is an old revision of the document!
If there is an extremely large number of messages (eg hundreds of thousands) in the VPOP3 OutQueue, then it may take a very long time for VPOP3 v5 and later to start as it check the message database tables for consistency during initialisation.
In this case, you can access the database directly to clean up the OutQueue.
At this point you may wish to see how many messages there are, and see if you can work out how they got there.
SELECT COUNT(*) FROM outqueue.outmessages;
SELECT COUNT(*) FROM outqueue.outmessages WHERE finishedtime IS NULL;
SELECT senderip, authsender, returnpath, subject, created FROM outqueue.outmessages ORDER BY msgid DESC LIMIT 10;
The three most common causes of unwanted messages in the OutQueue are:
To delete all the messages from the VPOP3 OutQueue, at the psql prompt, type:
DELETE FROM outqueue.outmessages;
If you know the IP address the unwanted messages came from, you could use:
DELETE FROM outqueue.outmessages WHERE senderip='<ip address>
'
If you know the authenticated sender the unwanted messages came from, you could use:
DELETE FROM outqueue.outmessages WHERE authsender='<username>
'
etc.
After deleting the messages, you may want to shrink the disk file, otherwise there will be a lot of wasted disk space. To do this, at the psql prompt, do:
CLUSTER VERBOSE outqueue.outmessages;
CLUSTER VERBOSE outqueue.outrecipients;