qmHandle is a great tool that can be used to manage your qmail queues.
It’s written in Perl so very fast and is great for clearing large queues on your server.
Here is some of the copy and paste examples I use on an almost daily basis:
Show current queue stats:
List messages in the mail queue:
List messages in the mail queue while counting how many have the same subject :
qmHandle -l|grep Subject|sort| uniq -c|sort -n
Read a message in the queue:
Delete a message in the queue:
Delete all messages in the queue:
Delete a message based on sender:
Delete a message based on subject:
qmHandle -S”failure notice”