Manage Qmail Queue using qmHandle ToolqmHandle is the best tool which can be used to manage the qmail message queue. It’s written in Perl (so fully customizable) and has more features than qmail-qread and qmail-qstat.
Download qmHandle installation file.
===========
wget
http://sourceforge.net/projects/qmhandle/files/latest/download===========
Unzip the tar file and install the script using the following command.
tar -xvzf qmhandle-x.x.tar.gz
Navigate to the installation directory, move qmHandle to /usr/local/sbin, and then give it executable permission. Thats it.
cd qmhandle-x.x.x
mv qmHandle /usr/local/sbin/
chmod +x /usr/local/sbin/qmHandle
You will be able to see a number of options using qmhandle -h
Some important commands are listed below.
Summary of qmail queue
[root@server ~]# qmHandle -s
Total messages: 225
Messages with local recipients: 0
Messages with remote recipients: 225
Messages with bounces: 0
Messages in preprocess: 0
or
qmHandle -l -c (-c turns on color)
List all emails in queue:
qmHandle -l
To list all the messages in the queue counting the number of messages with the same subject
qmHandle -l | grep Subject |sort | uniq -c | sort – n
Show email no N from queue:
qmHandle -mN
Delete email no N from queue:
qmHandle -dN
Show remote emails from queue:
qmHandle -R
Delete all messages from queue :
qmHandle -D
Try to force deliver messages from queue:
qmHandle -a
To remove messages with a particular subject
qmHandle -Ssubject