maillogs-changes home : internet : mail : toaster : custom programs :

Qmail Queue Tool (

This program will allow you to search and view messages in your qmail queue. It will also allow you to remove them, via expiration or deletion. It was written by Matt Simerson for the toaster users on


Download Mail::Toaster from

  • fetch Mail-Toaster.tar.gz
  • tar -xzf Mail-Toaster.tar.gz
  • cd Mail-Toaster-x.xx
  • perl Makefile.PL
  • make install
  • rehash

Run the script without any parameters and it will show you a menu of options.

Sample Output

To list messages in queue from matt:

  • ./Mail-Toaster/ -a list -s matt -h From

To list messages in queue with string "foo" in the headers:

  • ./Mail-Toaster/ -a list -s foo

User Preferences

There are two settings you can alter:

  • $qdir is the path to your qmail queue
  • $qcontrol is your qmail-send control directory

If you aren't using the defaults (/var/qmail/queue, /service/send"), edit and adjust those values.

Message Expiration

Expiring messages does not remove them from the queue. It merely alters their expiration time. The messages will be removed from the queue after qmail attempts to deliver them one last time.


In list mode, when showing messages in the queue, show which addresses delivery has failed for, so you know exactly why a message is still in the queue (useful for mailing lists with many recipients)

  • Interactive mode - step through messages offering to delete/expire/skip each
  • Clean mode - Leave qmail down after stopping it, useful for multiple invocations
  • Write the messages into a "inactive" queue before deleting them.
  • Ability to restore messages from "inactive" to the real queue.

Last modified on 4/8/05.