Guide updated on 29th of February 2016

Install qmHandle


As its name suggest, this script is designed to handle mail queue.

cd /downloads/
tar zxvf qmhandle-1.3.2.tar.gz
cd /downloads/qmhandle-1.3.2

Adapt the script /downloads/qmhandle-1.3.2/qmHandle to match our configuration (on line 29 and 30)

my ($stopqmail) = '/usr/bin/svc -d /service/qmail-send';
my ($startqmail) = '/usr/bin/svc -u /service/qmail-send';

Copy the script with the executables and check it's working

cp /downloads/qmhandle-1.3.2/qmHandle /usr/local/bin/
qmHandle

qmHandle v1.3.2
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
  -fsender : delete message from sender
  -f're'   : delete message from senders matching regular expression re
  -Stext   : delete all messages that have/contain text as Subject
  -h're'   : delete all messages with headers matching regular expression re (case insensitive)
  -b're'   : delete all messages with body matching regular expression re (case insensitive)
  -H're'   : delete all messages with headers matching regular expression re (case sensitive)
  -B're'   : delete all messages with body matching regular expression re (case sensitive)
  -t're'   : flag messages with recipients in regular expression 're' for earlier retry (note: this lengthens the time message can stay in queue)
  -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

List of optional features


Users comments
Color Coded Qmail Installation Key
  Regular Black Text     Qmail installation notes and summaries by the author.
  Bold Black Text     Commands to be run by you, the installer.
  Bold/Regular Red Text    Vital and/or critical information.
  Regular Blue text     Denotes helpful tips and hints or hyperlinks.
  Regular Orange Text     Command line output.
  Bold/Regular green text     Denotes the contents of a file or script.