# postqueue(1) - man - phpman

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



## NAME
       postqueue - Postfix queue control

## SYNOPSIS
   **To** **flush** **the** **mail** **queue**:

       **postqueue** [**-v**] [**-c** _config_dir_] **-f**

       **postqueue** [**-v**] [**-c** _config_dir_] **-i** _queue_id_

       **postqueue** [**-v**] [**-c** _config_dir_] **-s** _site_

   **To** **list** **the** **mail** **queue**:

       **postqueue** [**-v**] [**-c** _config_dir_] **-j**

       **postqueue** [**-v**] [**-c** _config_dir_] **-p**

## DESCRIPTION
       The  [**postqueue**(1)](https://www.chedong.com/phpMan.php/man/postqueue/1/markdown)  command implements the Postfix user interface for queue management. It im‐
       plements operations that are traditionally available via the [**sendmail**(1)](https://www.chedong.com/phpMan.php/man/sendmail/1/markdown)  command.   See  the
       [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown) command for queue operations that require super-user privileges such as deleting
       a message from the queue or changing the status of a message.

       The following options are recognized:

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

### -f

              This  option implements the traditional "**sendmail** **-q**" command, by contacting the Post‐
              fix [**qmgr**(8)](https://www.chedong.com/phpMan.php/man/qmgr/8/markdown) daemon.

              Warning: flushing undeliverable mail frequently will result in poor  delivery  perfor‐
              mance of all other mail.

### -i
              Schedule immediate delivery of deferred mail with the specified queue ID.

              This  option  implements  the  traditional  **sendmail**  **-qI**  command,  by contacting the
              [**flush**(8)](https://www.chedong.com/phpMan.php/man/flush/8/markdown) server.

              This feature is available with Postfix version 2.4 and later.

### -j
              result  is  a stream of zero or more JSON objects, one per queue file.  Each object is
              followed by a newline character to support simple streaming parsers. See "**JSON**  **OBJECT**
              **FORMAT**" below for details.

              This feature is available in Postfix 3.1 and later.

### -p
              tional **mailq** command, by contacting the Postfix [**showq**(8)](https://www.chedong.com/phpMan.php/man/showq/8/markdown) daemon.

              Each queue entry shows the queue file ID, message size, arrival time, sender, and  the
              recipients  that  still need to be delivered.  If mail could not be delivered upon the
              last attempt, the reason for failure is shown. The queue ID string is followed  by  an
              optional status character:

              *****      The message is in the **active** queue, i.e. the message is selected for delivery.

              **!**      The message is in the **hold** queue, i.e. no further delivery attempt will be made
                     until the mail is taken off hold.

              **#**      The message is forced to expire. See the [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown) options **-e** or **-f**.

                     This feature is available in Postfix 3.5 and later.

### -s
              Schedule immediate delivery of all mail that is queued for the named _site_. A numerical
              site  must  be specified as a valid RFC 5321 address literal enclosed in [], just like
              in email addresses.  The site must be eligible for  the  "fast  flush"  service.   See
              [**flush**(8)](https://www.chedong.com/phpMan.php/man/flush/8/markdown) for more information about the "fast flush" service.

              This  option  implements the traditional "**sendmail** **-qR**_site_" command, by contacting the
              Postfix [**flush**(8)](https://www.chedong.com/phpMan.php/man/flush/8/markdown) daemon.

### -v -v
              increasingly  verbose.  As of Postfix 2.3, this option is available for the super-user
              only.

## JSON OBJECT FORMAT
       Each JSON object represents one queue file; it is emitted as a single text line followed by a
       newline character.

       Object  members have string values unless indicated otherwise.  Programs should ignore object
       members that are not listed here; the list of members is expected to grow over time.

       **queue**___**name**
              The name of the queue where the message was found.  Note that the contents of the mail
              queue  may  change  while it is being listed; some messages may appear more than once,
              and some messages may be missed.

       **queue**___**id**
              The queue file name. The queue_id may be reused within a Postfix instance unless  "en‐
              able_long_queue_ids = true" and time is monotonic.  Even then, the queue_id is not ex‐
              pected to be unique between different Postfix instances.  Management  tools  that  re‐
              quire  a  unique  name  should combine the queue_id with the myhostname setting of the
              Postfix instance.

       **arrival**___**time**
              The number of seconds since the start of the UNIX epoch.

       **message**___**size**
              The number of bytes in the message header and body. This number does not include  mes‐
              sage envelope information. It is approximately equal to the number of bytes that would
              be transmitted via SMTP including the <CR><LF> line endings.

       **forced**___**expire**
              The message is forced to expire (**true** or **false**).  See the [**postsuper**(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown) options  **-e**  or
              **-f**.

              This feature is available in Postfix 3.5 and later.

       **sender** The envelope sender address.

### recipients
              An array containing zero or more objects with members:

              **address**
                     One recipient address.

              **delay**___**reason**
                     If  present,  the  reason for delayed delivery.  Delayed recipients may have no
                     delay reason, for example, while delivery is in progress, or after  the  system
                     was stopped before it could record the reason.

## SECURITY
       This program is designed to run with set-group ID privileges, so that it can connect to Post‐
       fix daemon processes.

## STANDARDS
       RFC 7159 (JSON notation)

## DIAGNOSTICS
       Problems are logged 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), and to the standard error stream.

## ENVIRONMENT
       MAIL_CONFIG
              Directory with the **main.cf** file. In order to avoid exploitation of set-group ID privi‐
              leges, a non-standard directory is allowed only if:

              •      The  name  is listed in the standard **main.cf** file with the **alternate**___**config**___**di**‐‐
                     **rectories** configuration parameter.

              •      The command is invoked by the super-user.

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

       **alternate**___**config**___**directories** **(empty)**
              A list of non-default Postfix configuration directories that may be specified with "-c
              config_directory" on the command line (in the case of [**sendmail**(1)](https://www.chedong.com/phpMan.php/man/sendmail/1/markdown), with the  "-C"  op‐
              tion), or via the MAIL_CONFIG environment parameter.

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

       **command**___**directory** **(see** **'postconf** **-d'** **output)**
              The location of all postfix administrative commands.

       **fast**___**flush**___**domains** **($relay**___**domains)**
              Optional list of destinations that are eligible for per-destination logfiles with mail
              that is queued to those destinations.

       **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".

       **trigger**___**timeout** **(10s)**
              The time limit for sending a trigger to a Postfix daemon (for example,  the  [**pickup**(8)](https://www.chedong.com/phpMan.php/man/pickup/8/markdown)
              or [**qmgr**(8)](https://www.chedong.com/phpMan.php/man/qmgr/8/markdown) daemon).

       Available in Postfix version 2.2 and later:

       **authorized**___**flush**___**users** **(static:anyone)**
              List of users who are authorized to flush the queue.

       **authorized**___**mailq**___**users** **(static:anyone)**
              List of users who are authorized to view the queue.

## FILES
       /var/spool/postfix, mail queue

## SEE ALSO
       [qmgr(8)](https://www.chedong.com/phpMan.php/man/qmgr/8/markdown), queue manager
       [showq(8)](https://www.chedong.com/phpMan.php/man/showq/8/markdown), list mail queue
       [flush(8)](https://www.chedong.com/phpMan.php/man/flush/8/markdown), fast flush service
       [sendmail(1)](https://www.chedong.com/phpMan.php/man/sendmail/1/markdown), Sendmail-compatible user interface
       [postsuper(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown), privileged 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

## README FILES
       Use "**postconf** **readme**___**directory**" or "**postconf** **html**___**directory**" to locate this information.
       ETRN_README, Postfix ETRN howto

## LICENSE
       The Secure Mailer license must be distributed with this software.

## HISTORY
       The postqueue command was introduced with Postfix version 1.1.

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



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