POSTSUPER(1) | General Commands Manual | POSTSUPER(1) |
postsuper - Postfix superintendent
postsuper [-psSv] [-c config_dir]
[-d queue_id]
[-h queue_id] [-H queue_id]
[-r queue_id] [directory ...]
The postsuper(1) command does maintenance jobs on the Postfix queue. Use of the command is restricted to the superuser. See the postqueue(1) command for unprivileged queue operations such as listing or flushing the mail queue.
By default, postsuper(1) performs the operations requested with the -s and -p command-line options on all Postfix queue directories - this includes the incoming, active and deferred directories with mail files and the bounce, defer, trace and flush directories with log files.
Options:
To delete multiple files, specify the -d option multiple times, or specify a queue_id of - to read queue IDs from standard input. For example, to delete all mail with exactly one recipient user@example.com:
mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "user@example.com" && $9 == "")
print $1 }
' | tr -d '*!' | postsuper -d -
Specify "-d ALL" to remove all messages; for example, specify "-d ALL deferred" to delete all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case.
Warning: Postfix queue IDs are reused (always with Postfix <= 2.8; and with Postfix >= 2.9 when enable_long_queue_ids=no). There is a very small possibility that postsuper deletes the wrong message file when it is executed while the Postfix mail system is delivering mail.
The scenario is as follows:
To hold multiple files, specify the -h option multiple times, or specify a queue_id of - to read queue IDs from standard input.
Specify "-h ALL" to hold all messages; for example, specify "-h ALL deferred" to hold all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case.
Note: while mail is "on hold" it will not expire when its time in the queue exceeds the maximal_queue_lifetime or bounce_queue_lifetime setting. It becomes subject to expiration after it is released from "hold".
This feature is available in Postfix 2.0 and later.
To release multiple files, specify the -H option multiple times, or specify a queue_id of - to read queue IDs from standard input.
Note: specify "postsuper -r" to release mail that was kept on hold for a significant fraction of $maximal_queue_lifetime or $bounce_queue_lifetime, or longer.
Specify "-H ALL" to release all mail that is "on hold". As a safety measure, the word ALL must be specified in upper case.
This feature is available in Postfix 2.0 and later.
To requeue multiple files, specify the -r option multiple times, or specify a queue_id of - to read queue IDs from standard input.
Specify "-r ALL" to requeue all messages. As a safety measure, the word ALL must be specified in upper case.
A requeued message is moved to the maildrop queue, from where it is copied by the pickup(8) and cleanup(8) daemons to a new queue file. In many respects its handling differs from that of a new local submission.
The address rewriting context (local or remote) is the same as when the message was received.
This feature is available in Postfix 1.1 and later.
# postfix stop # postconf enable_long_queue_ids=no # postsuper
Run postsuper(1) repeatedly until it stops reporting file name changes.
Problems are reported to the standard error stream and to syslogd(8) or postlogd(8).
postsuper(1) reports the number of messages deleted with -d, the number of messages requeued with -r, and the number of messages whose queue file name was fixed with -s. The report is written to the standard error stream and to syslogd(8) or postlogd(8).
Mail that is not sanitized by Postfix (i.e. mail in the maildrop queue) cannot be placed "on hold".
The following main.cf parameters are especially relevant to this program. The text below provides only a parameter summary. See postconf(5) for more details including examples.
Available in Postfix version 2.9 and later:
sendmail(1), Sendmail-compatible user interface postqueue(1), unprivileged queue operations postlogd(8), Postfix logging syslogd(8), system logging
The Secure Mailer license must be distributed with this software.
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA