Removing Queued Mail
Zero Knowledge Systems Inc.
November 2000
Abstract:
This document shows the step to manually remove a message from the queue, but
also shows how to use the mailRemove.py script to remove mail.
To remove a Message from a Qmail queue requires a few basic steps. Once the
message is located, it is just a matter of removing it from the different directories.
1.1 Locating the Message
To locate the message, there are different ways to do so:
- Use qmail-queue to see the list of message in the queue. From this the message
number appears in the listing.
- Go in the queue/mess directory and do a grep -r {string} * as user root.
This will show any messages with the 'string' in it.
Once the path to the message is known within the mess directory (this should
be a number from 0 to 22) the message can now be removed from the system.
These steps all have to be done as user root. Once the step in section 1.1is
done, these steps will remove the message from the queue:
- In the directory queue/mess/{sub_dir}1, do a ``rm {message_id}2''.
- In the directory queue/local/{sub_dir}, do a ``rm {message_id}''.
- In the directory queue/remote/{sub_dir}, do a ``rm {message_id}''.
- In the directory queue/info/{sub_dir}, do a ``rm {message_id}''.
- In the directory queue/intd/{sub_dir}, do a ``rm {message_id}''.
- In the directory queue/todo/{sub_dir}, do a ``rm {message_id}''.
Once these steps are followed, the message is removed from the queue and will
not be delivered. One should notice that no notification will be sent to anyone
that the message has been removed from the queue.
Using this script, someone can remove mail for a message in the queue using
any string within the message or by the id of the message in the queue. This
script was written by Dru Nelson using the Python language.
To run the mailRemove.py script, some things are needed first:
- Must be run as root
- The filter directory must exists under the queue directory.
- Python 1.5.2 or above is needed.
2.2.1 Listing the messages to be removed before removing them
As user root, mailRemove.py can first be run to find either:
- a string contained within a number of messages. Good if someone sent a bunch
of messages that need to be deleted. This is done by giving the string as argument
to the script.
- a string contained with a number of message given from a text file, each pattern
one per line. This can be done by using the -file=filename argument.
These steps will list any messages that will match the criteria given as arguments.
Once the list of messages listed from the steps in section 2.2.1
are checked to be the messages to be removed, the next step will actually remove
the messages.
- Run mailRemove.py with the same arguments as section 2.2.1,
but with the ``-real'' argument in front of the previously given argument.
This will move all messages that match the criteria into the queue/filter directory.
From there, all messages can be totally removed by doing a ``rm *''.
``nukeQueue.sh'' will wipe clean the queue when invoke as user root. It will
go through all the queue directories and will remove all the messages contained
within it.
To remove the message, type:
nukeQueue.sh
This will come back with a message that the queue has been emptied. If the queue
is listed for any messages, there are no messages left if no messages came in.
Removing Queued Mail
This document was generated using the
LaTeX2HTML translator Version 99.2beta8 (1.43)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -no_subdir -split 0 -show_section_numbers Removing_Queued_Mail.tex
The translation was initiated by Serge Chevarie-Pelletier on 2000-12-15
Footnotes
- ... queue/mess/\{sub\_dir\}1
- sub_dir is the dir number got from section 1.1
- ... \{message\_id\}2
- message_id is taken from the id found in section 1.1
Serge Chevarie-Pelletier
2000-12-15