For When You Can't Have The Real Thing
[ start | index | login ]
start > qmail > Quick Notes

Quick Notes

Created by dave. Last edited by dave, 6 years and 226 days ago. Viewed 2,288 times. #7
[diff] [history] [edit] [rdf]

Fucking qmail

Why fix things when you can re-invent the wheel?

Flush the queue

# kill -ALRM `pgrep qmail-send`


You probably have to prepend /var/qmail/bin/ to each command below.

Don't mess around in /var/qmail/queue directly. (Why? Because the incomprehensible numbers it uses for all the message files are based on the message body's inode number on the disk(!!) so moving things around at the shell level can hopelessly break things.)


  • terse, summary of the queue. Details in qmail-qread
  • lists tcp-timeout information for prospective targets.
  • stops qmail when running delete operations, then restarts qmail after delete operation
qmHandle -sShow current queue stats
qmHandle -lList messages in the queue
qmHandle -m123456789Read message 123456789 from the queue
qmhandle -d123456789Delete message 123456789 from the queue
qmHandle -DNuclear option: empty the queue completely, now
qmHandle -ftest@test.comDelete messages from
qmHandle -S"failure notice"Delete messages with subject failure notice
qmHandle -hpatternDelete messages with regex pattern in their headers

Figure out who sent messages in the queue:

# for i in `qmail-qread | grep '#' | awk '{print $6}' | sed -e 's/#//'` ; do echo $i `qmHandle -m$i | grep HELO` ; done

Apology of sorts

I'm mostly pissed because I've inherited a system with qmail on it, and my introduction to dealing with it has been while trying to filter out the five valid messages from 220000 spam messages in the queue. And of course this is a production system, so downtime is complaintime. So there's pressure.

Overall the more I get to know qmail the less I hate it. However since I discovered Sendmail's improved logging capability I've been less impressed with qmail's logging. Qmail's logging is fine when everything is going well, when they are not too many situations end up happening silently, making troubleshooting very difficult.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt