Archive for the “Qmail” Category

When the mail queue on a dedicated , shared or virtual server has messages stuck in it, qmHandle can be a very handy tool. Plesk also uses Qmail for it’s email server.  As long as you have shell access you will be able to install and use gmHandle.

* Download qmHandle from SourceForge. You actually only need the script ‘qmHandle’ so use that if you have it handy. Upload it to the server and untar it if necessary. You may download it from SourceForge using the following command;

wget http://mesh.dl.sourceforge.net/sourceforge/qmhandle/qmhandle-1.2.0.tar.gz

* Untar it by using;

tar -xvzf qmhandle-1.2.0.tar.gz

* First it is recommended to shutdown qmail to prevent possible corruption of the mail queue;

service qmail stop  

Make sure once you are done with Qmhandle to start your qmail back up by using;

server qmail start

* qmHandle can show it’s own options

./qmHandle

qmHandle v1.2.0
Copyright 1998-2003 Michele Beltrame

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

* -s to see some basic statistics

./qmHandle -s

* -s to delete entire mail queue

./qmHandle -D

* -s to force queue to send all queued messages. For this you will need qmail running.

./qmHandle -a

Comments No Comments »

If you even find yourself trying to remove emails from your mail queue, however only find that you can’t access the queue due to the shear amount of emails (legit and spam) in the queue, you can do the following to correct this.

Log into the account via Shell (SSH) as the admin or root to do this.

#!/bin/sh
# remove everything - STOP QMAIL FIRST!
/sbin/service qmail stop
for i in bounce info intd local mess remote todo; do
find /var/qmail/queue/$i -type f -exec rm {} \;
done
/sbin/service qmail start

Comments No Comments »