NAME

postsuper - Postfix superintendent

SYNOPSIS



ppoossttssuuppeerr [--ppssvv]
[--cc _c_o_n_f_i_g___d_i_r] [--dd _q_u_e_u_e___i_d]
        [--hh _q_u_e_u_e___i_d] [--HH _q_u_e_u_e___i_d]
        [--rr _q_u_e_u_e___i_d] [_d_i_r_e_c_t_o_r_y _._._.]

DESCRIPTION

The ppoossttssuuppeerr(1) command does maintenance jobs on the Postfix queue. Use of the command is restricted to the superuser. See the ppoossttqquueeuuee(1) command for unprivileged queue operations such as listing or flushing the mail queue.

By default, ppoossttssuuppeerr(1) performs the operations requested with the --ss and --pp command-line options on all Postfix queue directories - this includes the iinnccoommiinngg, aaccttiivvee and ddeeffeerrrreedd directories with mail files and the bboouunnccee, ddeeffeerr, ttrraaccee and fflluusshh directories with log files.

Options:

--cc _c_o_n_f_i_g___d_i_r The mmaaiinn..ccff configuration file is in the named directory
instead of the default configuration directory. See also the MAIL_CONFIG environment setting below.
--dd _q_u_e_u_e___i_d Delete one message with the named queue ID from the named
mail queue(s) (default: hhoolldd, iinnccoommiinngg, aaccttiivvee and ddeeffeerrrreedd).

If a _q_u_e_u_e___i_d of -- is specified, the program reads queue IDs from standard input. For example, to delete all mail with exactly one recipient uusseerr@@eexxaammppllee..ccoomm:


mailq | tail +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 "--dd AALLLL" to remove all messages; for example, specify "--dd AALLLL ddeeffeerrrreedd" to delete all mail in the ddeeffeerrrreedd queue. As a safety measure, the word AALLLL must be specified in upper case.

Warning: Postfix queue IDs are reused. 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:
1) The Postfix queue manager deletes the message that ppoossttssuuppeerr(1)
is asked to delete, because Postfix is finished with the message (it is delivered, or it is returned to the sender).
2) New mail arrives, and the new message is given the same queue ID
as the message that ppoossttssuuppeerr(1) is supposed to delete. The probability for reusing a deleted queue ID is about 1 in 2**15 (the number of different microsecond values that the system clock can distinguish within a second).
3) ppoossttssuuppeerr(1) deletes the new message, instead of the old
message that it should have deleted.
--hh _q_u_e_u_e___i_d Put mail "on hold" so that no attempt is made to deliver it.
Move one message with the named queue ID from the named mail queue(s) (default: iinnccoommiinngg, aaccttiivvee and ddeeffeerrrreedd) to the hhoolldd queue.

If a _q_u_e_u_e___i_d of -- is specified, the program reads queue IDs from standard input.

Specify "--hh AALLLL" to hold all messages; for example, specify "--hh AALLLL ddeeffeerrrreedd" to hold all mail in the ddeeffeerrrreedd queue. As a safety measure, the word AALLLL must be specified in upper case.

Note: while mail is "on hold" it will not expire when its time in the queue exceeds the mmaaxxiimmaall__qquueeuuee__lliiffeettiimmee or bboouunnccee__qquueeuuee__lliiffeettiimmee setting. It becomes subject to expiration after it is released from "hold".

This feature is available in Postfix 2.0 and later.

--HH _q_u_e_u_e___i_d Release mail that was put "on hold".
Move one message with the named queue ID from the named mail queue(s) (default: hhoolldd) to the ddeeffeerrrreedd queue.

If a _q_u_e_u_e___i_d of -- is specified, the program reads queue IDs from standard input.

Note: specify "ppoossttssuuppeerr --rr" to release mail that was kept on hold for a significant fraction of $$mmaaxxiimmaall__qquueeuuee__lliiffeettiimmee or $$bboouunnccee__qquueeuuee__lliiffeettiimmee, or longer.

Specify "--HH AALLLL" to release all mail that is "on hold". As a safety measure, the word AALLLL must be specified in upper case.

This feature is available in Postfix 2.0 and later.

--pp Purge old temporary files that are left over after system or
software crashes.
--rr _q_u_e_u_e___i_d Requeue the message with the named queue ID from the named
mail queue(s) (default: hhoolldd, iinnccoommiinngg, aaccttiivvee and ddeeffeerrrreedd). To requeue multiple messages, specify multiple --rr command-line options.

Alternatively, if a _q_u_e_u_e___i_d of -- is specified, the program reads queue IDs from standard input.

Specify "--rr AALLLL" to requeue all messages. As a safety measure, the word AALLLL must be specified in upper case.

A requeued message is moved to the mmaaiillddrroopp queue, from where it is copied by the ppiicckkuupp(8) and cclleeaannuupp(8) daemons to a new queue file. In many respects its handling differs from that of a new local submission.

· The message is not subjected to the smtpd_milters or
non_smtpd_milters settings. When mail has passed through an external content filter, this would produce incorrect results with Milter applications that depend on original SMTP connection state information.
· The message is subjected again to mail address rewriting
and substitution. This is useful when rewriting rules or virtual mappings have changed.

The address rewriting context (local or remote) is the same as when the message was received.
· The message is subjected to the same content_filter settings
(if any) as used for new local mail submissions. This is useful when content_filter settings have changed.
Warning: Postfix queue IDs are reused.
There is a very small possibility that ppoossttssuuppeerr(1) requeues the wrong message file when it is executed while the Postfix mail system is running, but no harm should be done.

This feature is available in Postfix 1.1 and later.
--ss Structure check and structure repair. This should be done once
before Postfix startup.
· Rename files whose name does not match the message file inode
number. This operation is necessary after restoring a mail queue from a different machine, or from backup media.
· Move queue files that are in the wrong place in the file system
hierarchy and remove subdirectories that are no longer needed. File position rearrangements are necessary after a change in the hhaasshh__qquueeuuee__nnaammeess and/or hhaasshh__qquueeuuee__ddeepptthh configuration parameters.
--vv Enable verbose logging for debugging purposes. Multiple --vv
options make the software increasingly verbose.

DIAGNOSTICS

Problems are reported to the standard error stream and to ssyyssllooggdd(8).

ppoossttssuuppeerr(1) reports the number of messages deleted with --dd, the number of messages requeued with --rr, and the number of messages whose queue file name was fixed with --ss. The report is written to the standard error stream and to ssyyssllooggdd(8).

ENVIRONMENT



MAIL_CONFIG Directory with the mmaaiinn..ccff file.

BUGS

Mail that is not sanitized by Postfix (i.e. mail in the mmaaiillddrroopp queue) cannot be placed "on hold".

CONFIGURATION PARAMETERS



The following mmaaiinn..ccff parameters are especially relevant to
this program.
The text below provides only a parameter summary. See
ppoossttccoonnff(5) for more details including examples.
ccoonnffiigg__ddiirreeccttoorryy ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The default location of the Postfix main.cf and master.cf
configuration files.
hhaasshh__qquueeuuee__ddeepptthh ((11)) The number of subdirectory levels for queue directories listed with
the hash_queue_names parameter.
hhaasshh__qquueeuuee__nnaammeess ((ddeeffeerrrreedd,, ddeeffeerr)) The names of queue directories that are split across multiple
subdirectory levels.
qquueeuuee__ddiirreeccttoorryy ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The location of the Postfix top-level queue directory.
ssyysslloogg__ffaacciilliittyy ((mmaaiill)) The syslog facility of Postfix logging.
ssyysslloogg__nnaammee ((sseeee ''ppoossttccoonnff --dd'' oouuttppuutt)) The mail system name that is prepended to the process name in syslog
records, so that "smtpd" becomes, for example, "postfix/smtpd".

SEE ALSO


sendmail(1), Sendmail-compatible user interface
postqueue(1), unprivileged queue operations

LICENSE



The Secure Mailer license must be distributed with this software.

AUTHOR(S)


Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA