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.
qqtool.pl - A tool for viewing and purging messages from a qmail queue
-a action (delete, expire, list) -h header to match (From, To, Subject, Date) -q queue to search (local/remote) -s search (pattern to search for) -v verbose If no -h is specified, then the pattern is searched for in any header. If no -q is specified, then both queues are searched. To list messages in queue from matt: qqtool.pl -a list -s matt -h From To list messages in queue with string \"foo\" in the headers: qqtool.pl -a list -s foo
Qmail Queue Tool (qqtool.pl)
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 firstname.lastname@example.org
Download Mail::Toaster from http://mail-toaster.org/Mail-Toaster.tar.gz
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.
# qqtool.pl Qmail Queue Tool v 1.9 -a action (delete, expire, list) -h header to match (From, To, Subject, Date) -q queue to search (local/remote) -s search (pattern to search for) -v verbose
If no -h is specified, then the pattern is searched for in any header. If no -q is specified, then both queues are searched.
To list messages in queue from matt:
./Mail-Toaster/qqtool.pl -a list -s matt -h From
To list messages in queue with string "foo" in the headers:
./Mail-Toaster/qqtool.pl -a list -s foo
There is one settings you can alter:
$qdir is the path to your qmail queue
If you aren't using the default (/var/qmail/queue), edit qqtool.pl and adjust it.
Matt Simerson <email@example.com>
Idea based on mailRemove.py by Dru Nelson <firstname.lastname@example.org>, ideas borrowed from qmHandle by Michele Beltrame <email@example.com>
Community funding was contributed by the following firstname.lastname@example.org mailing list subscribers:
erik erik at microcontroller.nl (organizer) Rick Romero rick at valeoinc.com Chris Eaton Chris.Eaton at med.ge.com Marius Kirschner marius at agoron.com J. Vicente Carrasco carvay at teleline.es Chris Odell chris at redstarnetworks.net Pat Hayes pat at pathayes.net Dixon Cole dixon at levee.net Randy Meyer rjmeyer at humbleguys.net kristian kristian at waveit.com Michael Andreasen michael at subwire.dk (beer) Nathan Nieblas nnieblas at microtosh.net Randy Jordan ctech at pcwarp.com
Report to author. Patches welcome.
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.
Copyright 2003-2013, The Network People, Inc. All Rights Reserved.