# postsuper(1) - man - phpMan

[POSTSUPER(1)](https://www.chedong.com/phpMan.php/man/POSTSUPER/1/markdown)                           General Commands Manual                          [POSTSUPER(1)](https://www.chedong.com/phpMan.php/man/POSTSUPER/1/markdown)



## NAME
       postsuper - Postfix superintendent

## SYNOPSIS
       **postsuper** [**-psSv**]
               [**-c** _config_dir_] [**-d** _queue_id_]
               [**-e** _queue_id_] [**-f** _queue_id_]
               [**-h** _queue_id_] [**-H** _queue_id_]
               [**-r** _queue_id_] [_directory_ _..._]

## DESCRIPTION
       The  [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown)  command  does maintenance jobs on the Postfix queue. Use of the command is
       restricted to the superuser.  See the [**postqueue**(1)](https://www.chedong.com/phpMan.php/man/postqueue/1/markdown) command for unprivileged queue  operations
       such as listing or flushing the mail queue.

       By  default,  [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown)  performs the operations requested with the **-s** and **-p** command-line
       options on all Postfix queue directories - this includes the **incoming**, **active**, **deferred**,  and
       **hold**  directories  with message files and the **bounce**, **defer**, **trace** and **flush** directories with
       log files.

       Options:

### -c
              The **main.cf** configuration file is in the named directory instead of the  default  con‐
              figuration directory. See also the MAIL_CONFIG environment setting below.

### -d
              Delete  one  message  with  the  named queue ID from the named mail queue(s) (default:
              **hold**, **incoming**, **active** and **deferred**).

              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 ex‐
              actly one recipient **<user@example.com>**:

              postqueue -j | jq '
                  # See JSON OBJECT FORMAT section in the [postqueue(1)](https://www.chedong.com/phpMan.php/man/postqueue/1/markdown) manpage
                  select(.recipients[0].address == "<user@example.com>")
                  | select(.recipients[1].address == null)
                  | .queue_id
               ' | postsuper -d -

              Or the historical form:

              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:

              1)     The  Postfix  queue  manager  deletes the message that [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown) 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 [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown) 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)     [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown) deletes the new message, instead of the old message that it should
                     have deleted.

### -e

### -f
              Request  forced  expiration  for one message with the named queue ID in the named mail
              queue(s) (default: **hold**, **incoming**, **active** and **deferred**).

              •      The message will be returned to the sender when the queue manager  attempts  to
                     deliver that message (note that Postfix will never deliver messages in the **hold**
                     queue).

              •      The **-e** and **-f** options both request forced expiration. The difference is that **-f**
                     will also release a message if it is in the **hold** queue. With **-e**, such a message
                     would not be returned to the sender until it is released with **-f** or **-H**.

              •      When a deferred message is force-expired, the return  message  will  state  the
                     reason  for  the  delay.  Otherwise, the reason will be "message is administra‐
                     tively expired".

              To expire multiple files, specify the **-e** or **-f** option multiple  times,  or  specify  a
              _queue_id_  of  **-**  to read queue IDs from standard input (see the **-d** option above for an
              example, but be sure to replace **-d** in the example).

              Specify "**-e** **ALL**" or "**-f** **ALL**" to expire all messages; for example, specify "**-e** **ALL**  **de**‐‐
              **ferred**"  to  expire all mail in the **deferred** queue.  As a safety measure, the word **ALL**
              must be specified in upper case.

              These features are available in Postfix 3.5 and later.

### -h
              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: **incoming**, **active** and **de**‐‐
              **ferred**) to the **hold** queue.

              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 ex‐
              piration after it is released from "hold".

              This feature is available in Postfix 2.0 and later.

### -H
              Release  mail  that  was put "on hold".  Move one message with the named queue ID from
              the named mail queue(s) (default: **hold**) to the **deferred** queue.

              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.

### -p
              **-p**, **-s**, and **-S** operations are done before other operations.

### -r
              Requeue the message with the named queue ID from the  named  mail  queue(s)  (default:
              **hold**, **incoming**, **active** and **deferred**).

              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)](https://www.chedong.com/phpMan.php/man/pickup/8/markdown) and [**cleanup**(8)](https://www.chedong.com/phpMan.php/man/cleanup/8/markdown) 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 set‐
                     tings.  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 (always with Postfix <= 2.8; and with Postfix >=
              2.9  when  enable_long_queue_ids=no).   There is a very small possibility that **postsu**‐‐
              [**per**(1)](https://www.chedong.com/phpMan.php/man/per/1/markdown) requeues the wrong message file when it is executed while the Postfix mail sys‐
              tem is running, but no harm should be done.

              This feature is available in Postfix 1.1 and later.

### -s
              startup.  The **-p**, **-s**, and **-S** operations are done before other operations.

              •      Rename files whose name does not match the message file inode number. This  op‐
                     eration  is  necessary after restoring a mail queue from a different machine or
                     from backup, when queue files were created with Postfix <=  2.8  or  with  "en‐
                     able_long_queue_ids = no".

              •      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 **hash**___**queue**___**names** and/or **hash**___**queue**___**depth**
                     configuration parameters.

              •      Rename queue files created with "enable_long_queue_ids = yes" to  short  names,
                     for migration to Postfix <= 2.8.  The procedure is as follows:

                     # postfix stop
                     # postconf enable_long_queue_ids=no
                     # postsuper

                     Run [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown) repeatedly until it stops reporting file name changes.

### -S -s
              file inode number. This option exists for testing  purposes,  and  is  available  with
              Postfix  2.9  and  later.   The **-p**, **-s**, and **-S** operations are done before other opera‐
              tions.

### -v -v
              increasingly verbose.

## DIAGNOSTICS
       Problems are reported to the standard error stream and to [**syslogd**(8)](https://www.chedong.com/phpMan.php/man/syslogd/8/markdown) or [**postlogd**(8)](https://www.chedong.com/phpMan.php/man/postlogd/8/markdown).

       [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown)  reports  the number of messages deleted with **-d**, the number of messages expired
       with **-e**, the number of messages expired or released with **-f**, the number of messages  held  or
       released  with  **-h** or **-H**, 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)](https://www.chedong.com/phpMan.php/man/syslogd/8/markdown) or [**postlogd**(8)](https://www.chedong.com/phpMan.php/man/postlogd/8/markdown).

## ENVIRONMENT
       MAIL_CONFIG
              Directory with the **main.cf** file.

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

## CONFIGURATION PARAMETERS
       The following **main.cf** parameters are especially relevant to this  program.   The  text  below
       provides only a parameter summary. See [**postconf**(5)](https://www.chedong.com/phpMan.php/man/postconf/5/markdown) for more details including examples.

       **config**___**directory** **(see** **'postconf** **-d'** **output)**
              The default location of the Postfix main.cf and master.cf configuration files.

       **hash**___**queue**___**depth** **(1)**
              The   number   of   subdirectory   levels   for  queue  directories  listed  with  the
              hash_queue_names parameter.

       **hash**___**queue**___**names** **(deferred,** **defer)**
              The names of queue directories that are split across multiple subdirectory levels.

       **import**___**environment** **(see** **'postconf** **-d'** **output)**
              The list of environment parameters that a privileged Postfix process will import  from
              a non-Postfix parent process, or name=value environment overrides.

       **queue**___**directory** **(see** **'postconf** **-d'** **output)**
              The location of the Postfix top-level queue directory.

       **syslog**___**facility** **(mail)**
              The syslog facility of Postfix logging.

       **syslog**___**name** **(see** **'postconf** **-d'** **output)**
              A  prefix  that is prepended to the process name in syslog records, so that, for exam‐
              ple, "smtpd" becomes "prefix/smtpd".

       Available in Postfix version 2.9 and later:

       **enable**___**long**___**queue**___**ids** **(no)**
              Enable long, non-repeating, queue IDs (queue file names).

## SEE ALSO
       [sendmail(1)](https://www.chedong.com/phpMan.php/man/sendmail/1/markdown), Sendmail-compatible user interface
       [postqueue(1)](https://www.chedong.com/phpMan.php/man/postqueue/1/markdown), unprivileged queue operations
       [postlogd(8)](https://www.chedong.com/phpMan.php/man/postlogd/8/markdown), Postfix logging
       [syslogd(8)](https://www.chedong.com/phpMan.php/man/syslogd/8/markdown), system logging

## 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

       Wietse Venema
       Google, Inc.
       111 8th Avenue
       New York, NY 10011, USA



                                                                                        [POSTSUPER(1)](https://www.chedong.com/phpMan.php/man/POSTSUPER/1/markdown)
