Sometimes it may be desirable to delete all items from qmali’s mail queue. The safest way to clean the outbound queue in qmail is to trick qmail into thinking the messages have been around for too long, so it’ll give up and discard the messages. This can be done using find in conjunction with touch:

find /var/qmail/queue/ -type f -depth | xargs touch -t 200001010101 {} ;

Once we’ve touched the messages we then need to signal qmail to re-run the queue :

killall -ALRM qmail-send

Keep an eye on /var/log/maillog to check the progress:

tail -F /var/log/maillog

And that’s it!

Source: http://jerrywalsh.org/how-to-empty-purge-the-qmail-outbound-queue-12.html

Advertisement