-
-
Notifications
You must be signed in to change notification settings - Fork 3
qmail rm.1
qmail-rm - Remove mails from Queue
qmail-rm [-eidrvh] [-n NUM] [-p pattern] [-q qbase] [-s split] [-y yankdir] [-X secs] [-f date_format] [-x timespec]
qmail-rm will remove messages containing a particular string from your qmail queue.
qmail-rm is useful for removing mails from queue if hit by sudden SPAM. For instance, if you are hit with a spamming attack, you can temporarily instate a second qmail installation (once the spam run is finished), allow it to take over mail receipt, and then use this tool to clean the offending mails out of the queue before switching over to the main qmail installation once again.
Occasionally, viruses will get past scanners before the signatures get updated; if they exist in large numbers, it is often practical to stop the qmail install briefly in order to clean out all messages containing a signature related to the virus.
Whatever the reason to pull items from your mail queue, this program will delete them in such a manner that will let you restore them easily.
Mails are *not* deleted from the queue! They are only stored, temporarily, in qbase/queue/trash/, where you can view them individually and restore them back to the queue manually. There is currently no support for restoring them automatically.
By default, qmail-rm assumes that your qmail queue is stored in /var/indimail/queue, but this can be changed with a command line option. Similarly, qmail-rm assumes that your queue "split" is 151 by default, among other things. You can change this by setting CONFSPLIT environment variable to a max of 151. qmail-rm can process a queue created with todo, intd with subdirectory split instead of without any split. This can be done by setting the BIGTODO environment variable.
See qmail-rm -h for more commandline options.
WARNING: YOU MUST STOP qmail-send BEFORE USING THIS PROGRAM.
-e
use extended POSIX regular expressions
-i
search case insensitively [default: case sensitive]
-n bytes
limit our search to the first bytes bytes of each file
-p pattern
specify the pattern to search for
-q qbase
specify the base qmail queue dir [default: /var/indimail/queue]. This
directory has indimail's multiple qmail queues.
-d
actually remove files not yank them, no -p will delete all the messages!
-r
actually remove files, without this we'll only print them
-s split
specify your conf-split value if non-standard [default: SPLIT]
-y yankdir
directory to put files trash from the queue [default:
qbase/queue/trash]
-X secs
modify timestamp on matching files, to make qmail expire mail. secs is
the number of seconds we want to move the file into the past. specifying
a value of 0 causes this to default to [604800] which is 7 x 86400.
-f date_format
Specify date/time format for strptime(3). Default format is "%a %b
%d %H:%M:%S %Z %Y".
-x timespec
modify timestamp on matching files, to make qmail expire mail.
timespec is a date/time format. The default format is "%a %b %d
%H:%M:%S %Z %Y". See manpage for strptime(3) for details of this
format.
Restamp mails to May 11 22:04:54 IST 2024
qmail-rm -x "Sat May 11 22:04:54 IST 2024"
qmail-rm -x "11-05-2024 22:04:54" -f "%d-%m-%Y %H:%M:%S"
-v
increase verbosity (can be used more than once)
-h, -?
this help message
Author qmail-rm has been adapted from qmail-remove at https://www.linuxmagic.com/opensource/qmail/qmail-remove