Gaining control over the qmail queue

Ever used qmail? Ever had a mail stuck in the queue that just wouldn’t send?

Then you might want to give qmHandle a try. It’s a small tool you’ll need to download (~16KB), and it’ll save you quite some time.

Running “qmHandle -l” lists the current queue. Nothing special about that, running “/var/qmail/bin/qmail-qstat” will do the same. Then how do you send the mails stuck in the queue? The logs won’t tell you the reason why they’re still in there. Running “qmHandle -a” will force the mails in queue to be sent. If for some reason this still fails, the mails will remain in queue.

Now try deleting a mail (or a series of mails) from the queue, based on – let’s say – the subject. Now it gets harder if you want to use qmail’s built-in tools.

qmHandle simplifies this. Running the command “qmHandle -S’Viagra Penis Enlargments’ ” will delete all messages from the queue, where the subject contains the string contained in single quotes (note: the single quotes have to be entered directly after -S, there can be no space in between).

qmHandle has a lot more functionality, which you can discover by typing “qmHandle“. It’ll give you an output as follows:

Available parameters:

-a : try to send queued messages now (qmail must be running)

-l : list message queues

-L : list local message queue

-R : list remote message queue

-s : show some statistics

-mN : display message number N

-dN : delete message number N

-Stext : delete all messages that have/contain text as Subject

-D : delete all messages in the queue (local and remote)

-V : print program version
Additional (optional) parameters:

-c : display colored output

-N : list message numbers only

(to be used either with -l, -L or -R)

You can view/delete multiple message i.e. -d123 -v456 -d567

Just explore qmHandle a bit, you’ll find it quite nice and invaluable when working with a qmail-enabled system.

Spread the word
If you liked the content of this article, please vote for it on the following websites - thanks.
  • Facebook
  • Twitter
  • del.icio.us
  • LinkedIn
  • DZone
  • Reddit
  • Digg
  • StumbleUpon
  • Sphinn
This entry was posted in Technology and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">