The Qmail-Remove utility will remove messages containing a particular string from your Qmail queue.
This is a useful utility for a number of situations. For instance, if you are hit with a spamming attack, you can temporarily instate a second Qmail installation (once the spam run is finished), allow it to take over mail receipt, and then use this tool to clean the offending mails out of the queue before switching over to the main Qmail installation once again.
Occasionally, viruses will get past scanners before the signatures get updated. If they exist in large numbers, it is often practical to stop the Qmail install briefly in order to clean out all messages containing a signature related to the virus.
Whatever the reason to pull items from your mail queue, this program will delete them in such a manner that will let you restore them easily.
Emails are not deleted from the queue. They are only stored, temporarily, in $qmail-queue/yanked/, where you can view them individually and restore them back to the queue manually. At this time, there is currently no support for restoring them automatically.
By default, Qmail-Remove assumes that your Qmail queue is stored in /var/qmail/queue, but this can be changed with a command line option. Similarly, Qmail-Remove assumes that your queue "split" is 23 by default, among other things.
See Qmail-Remove -h for more command line options.
WARNING: YOU MUST STOP QMAIL BEFORE USING THIS PROGRAM.