Fucking qmail
Why fix things when you can re-invent the wheel?
Flush the queue
# kill -ALRM `pgrep qmail-send`
Queue
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.)
qmail-qstat
- terse, summary of the queue. Details in qmail-qread
qmail-tcpto
- lists tcp-timeout information for prospective targets.
qmHandle
- stops qmail when running delete operations, then restarts qmail after delete operation
Command | Explanation |
---|
qmHandle -s | Show current queue stats |
qmHandle -l | List messages in the queue |
qmHandle -m123456789 | Read message 123456789 from the queue |
qmhandle -d123456789 | Delete message 123456789 from the queue |
qmHandle -D | Nuclear option: empty the queue completely, now |
qmHandle -ftest@test.com | Delete messages from test@test.com |
qmHandle -S"failure notice" | Delete messages with subject failure notice |
qmHandle -hpattern | Delete 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.