Manage the Qmail queue with qmHandle

qmHandle is a tool which can be used to manage the qmail message queue.

  • Check if qmHandle is already installed on the VPS using the Linux command::which
  • which qmHandle
  • If qmHandle is not installed you will receive the message "no qmHandle in..."
  • qmhandle1

Install qmHandle

  1. Grab the installation using the Linux command::wget and extract it with the Linux command::tar
  2. wget http://voxel.dl.sourceforge.net/sourceforge/qmhandle/qmhandle-1.3.2.tar.gztar -xvzf qmhandle-1.3.2.tar.gz
  3. Enter the installation directory, move qmHandle to /usr/local/sbin, and then mark it executable with Linux command::chmod
  4. cd qmhandle-1.3.2mv qmHandle /usr/local/sbin/chmod +x /usr/local/sbin/qmHandle

qmHandle Usage

  • Get a listing of the options for this program using the following command
  • qmHandle 
    -a : try to send all 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 & remote) 
    -V : print program version
  • Get a summary of the Qmail queue
  • qmHandle -l -c (-c turns on color, which makes things easier to read)

    qmhandle3

  • To see stats about each message in the queue
  • qmHandle -l

    qmhandle4

  • To see a particular message
  • qmHandle -m[message_number]

    qmhandle5

  • To remove all messages matching a certain subject from the queue use the following command
  • qmHandle -S"subject text"
  • Delete all messages in the incoming and outgoing queues
  • qmHandle -D

    qmhandle6

  • To re-process the queue
  • qmHandle -a
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Installing htop

htop is an interactive process viewer for Linux, which is a powerful alternative to the...

Bind Multiple IP Addresses to a Single Network Interface Card (NIC)

This tutorial demonstrates how to bind multiple IP addresses to a single NICI'll be using LAN...

Clear Memory Cache on Linux Server

By default the Linux OS has a very efficient memory management process that should be freeing any...

Set the time on a Linux server

Log into the server via SSHAt the shell prompt run the following command:date MMDDHHmmYYYYFor...

Check your disk usage in Linux

A good way to check your disk usage for folders on your Linux server is via shell.Download...