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.

Looking for help?

Tired of fixing all these tech-problems yourself? We've got an excellent team at Nucleus, a top-class Belgian hosting provider, that can help you. Discover our Managed Hosting, where skilled engineers manage your servers and keep them up-to-date, so you can focus on your core business. We use a variety of Configuration Management Systems such as Puppet to make sure every config is reviewed, unit-tested and guaranteed to be working.

Want to get in touch? Find me as @mattiasgeniar on Twitter or via the contact-page on my blog.

Tagged with: , , ,
Posted in Technology
0 comments on “Gaining control over the qmail queue
3 Pings/Trackbacks for "Gaining control over the qmail queue"
  1. [...] Display the mail queue: /var/qmail/bin/qmail-qread Display the number of messages in the queue: /var/qmail/bin/qmail-qstat Reference article: Gaining Control Over the QMail Queue [...]

  2. [...] Visualice la cola de correo: / var / qmail / bin / qmail-qread Muestra el número de mensajes en la cola: / var / qmail / bin / qmail-qstat Artículo de referencia: tomando control de la QMail Queue [...]

  3. [...] Visualice la cola de correo: / var / qmail / bin / qmail-qread Muestra el número de mensajes en la cola: / var / qmail / bin / qmail-qstat Artículo de referencia: tomando control de la QMail Queue [...]

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>