1POSTQUEUE(1)                General Commands Manual               POSTQUEUE(1)
2
3
4

NAME

6       postqueue - Postfix queue control
7

SYNOPSIS

9   To flush the mail queue:
10
11       postqueue [-v] [-c config_dir] -f
12
13       postqueue [-v] [-c config_dir] -i queue_id
14
15       postqueue [-v] [-c config_dir] -s site
16
17   To list the mail queue:
18
19       postqueue [-v] [-c config_dir] -j
20
21       postqueue [-v] [-c config_dir] -p
22

DESCRIPTION

24       The  postqueue(1)  command  implements  the  Postfix user interface for
25       queue management.  It  implements  operations  that  are  traditionally
26       available  via  the  sendmail(1) command.  See the postsuper(1) command
27       for queue operations that require super-user privileges such as  delet‐
28       ing a message from the queue or changing the status of a message.
29
30       The following options are recognized:
31
32       -c config_dir
33              The main.cf configuration file is in the named directory instead
34              of the default configuration directory. See also the MAIL_CONFIG
35              environment setting below.
36
37       -f     Flush the queue: attempt to deliver all queued mail.
38
39              This option implements the traditional "sendmail -q" command, by
40              contacting the Postfix qmgr(8) daemon.
41
42              Warning: flushing undeliverable mail frequently will  result  in
43              poor delivery performance of all other mail.
44
45       -i queue_id
46              Schedule  immediate delivery of deferred mail with the specified
47              queue ID.
48
49              This option implements the traditional sendmail -qI command,  by
50              contacting the flush(8) server.
51
52              This feature is available with Postfix version 2.4 and later.
53
54       -j     Produce a queue listing in JSON format, based on output from the
55              showq(8) daemon.  The result is a stream of zero  or  more  JSON
56              objects,  one per queue file.  Each object is followed by a new‐
57              line character to support simple streaming  parsers.  See  "JSON
58              OBJECT FORMAT" below for details.
59
60              This feature is available in Postfix 3.1 and later.
61
62       -p     Produce a traditional sendmail-style queue listing.  This option
63              implements the traditional  mailq  command,  by  contacting  the
64              Postfix showq(8) daemon.
65
66              Each  queue entry shows the queue file ID, message size, arrival
67              time, sender, and the recipients that still need  to  be  deliv‐
68              ered.  If mail could not be delivered upon the last attempt, the
69              reason for failure is shown. The queue ID string is followed  by
70              an optional status character:
71
72              *      The  message  is in the active queue, i.e. the message is
73                     selected for delivery.
74
75              !      The message is in the hold queue, i.e. no further  deliv‐
76                     ery  attempt  will  be  made  until the mail is taken off
77                     hold.
78
79              #      The message is forced to  expire.  See  the  postsuper(1)
80                     options -e or -f.
81
82                     This feature is available in Postfix 3.5 and later.
83
84       -s site
85              Schedule  immediate  delivery of all mail that is queued for the
86              named site. A numerical site must be specified as  a  valid  RFC
87              5321  address  literal  enclosed  in  [],  just  like  in  email
88              addresses.  The site must be eligible for the "fast flush"  ser‐
89              vice.   See flush(8) for more information about the "fast flush"
90              service.
91
92              This option implements the traditional "sendmail  -qRsite"  com‐
93              mand, by contacting the Postfix flush(8) daemon.
94
95       -v     Enable  verbose  logging  for  debugging  purposes.  Multiple -v
96              options make the software increasingly verbose.  As  of  Postfix
97              2.3, this option is available for the super-user only.
98

JSON OBJECT FORMAT

100       Each  JSON  object represents one queue file; it is emitted as a single
101       text line followed by a newline character.
102
103       Object members have string values unless indicated otherwise.  Programs
104       should ignore object members that are not listed here; the list of mem‐
105       bers is expected to grow over time.
106
107       queue_name
108              The name of the queue where the message was  found.   Note  that
109              the  contents  of  the  mail  queue may change while it is being
110              listed; some messages may appear more than once, and  some  mes‐
111              sages may be missed.
112
113       queue_id
114              The queue file name. The queue_id may be reused within a Postfix
115              instance unless "enable_long_queue_ids = true" and time is mono‐
116              tonic.   Even  then,  the  queue_id is not expected to be unique
117              between different  Postfix  instances.   Management  tools  that
118              require  a  unique  name  should  combine  the queue_id with the
119              myhostname setting of the Postfix instance.
120
121       arrival_time
122              The number of seconds since the start of the UNIX epoch.
123
124       message_size
125              The number of bytes in the message header and body. This  number
126              does  not  include  message envelope information. It is approxi‐
127              mately equal to the number of bytes that  would  be  transmitted
128              via SMTP including the <CR><LF> line endings.
129
130       forced_expire
131              The  message is forced to expire (true or false).  See the post‐
132              super(1) options -e or -f.
133
134              This feature is available in Postfix 3.5 and later.
135
136       sender The envelope sender address.
137
138       recipients
139              An array containing zero or more objects with members:
140
141              address
142                     One recipient address.
143
144              delay_reason
145                     If present, the reason  for  delayed  delivery.   Delayed
146                     recipients  may  have no delay reason, for example, while
147                     delivery is in progress, or after the system was  stopped
148                     before it could record the reason.
149

SECURITY

151       This  program  is designed to run with set-group ID privileges, so that
152       it can connect to Postfix daemon processes.
153

STANDARDS

155       RFC 7159 (JSON notation)
156

DIAGNOSTICS

158       Problems are logged to syslogd(8) or postlogd(8), and to  the  standard
159       error stream.
160

ENVIRONMENT

162       MAIL_CONFIG
163              Directory  with the main.cf file. In order to avoid exploitation
164              of set-group ID privileges, a non-standard directory is  allowed
165              only if:
166
167              ·      The  name is listed in the standard main.cf file with the
168                     alternate_config_directories configuration parameter.
169
170              ·      The command is invoked by the super-user.
171

CONFIGURATION PARAMETERS

173       The following main.cf parameters are especially relevant to  this  pro‐
174       gram.   The  text  below  provides  only a parameter summary. See post‐
175       conf(5) for more details including examples.
176
177       alternate_config_directories (empty)
178              A list of non-default Postfix configuration directories that may
179              be  specified with "-c config_directory" on the command line (in
180              the case of sendmail(1), with  the  "-C"  option),  or  via  the
181              MAIL_CONFIG environment parameter.
182
183       config_directory (see 'postconf -d' output)
184              The  default  location of the Postfix main.cf and master.cf con‐
185              figuration files.
186
187       command_directory (see 'postconf -d' output)
188              The location of all postfix administrative commands.
189
190       fast_flush_domains ($relay_domains)
191              Optional list of destinations that are eligible for per-destina‐
192              tion logfiles with mail that is queued to those destinations.
193
194       import_environment (see 'postconf -d' output)
195              The  list  of  environment  parameters that a privileged Postfix
196              process will  import  from  a  non-Postfix  parent  process,  or
197              name=value environment overrides.
198
199       queue_directory (see 'postconf -d' output)
200              The location of the Postfix top-level queue directory.
201
202       syslog_facility (mail)
203              The syslog facility of Postfix logging.
204
205       syslog_name (see 'postconf -d' output)
206              A  prefix  that  is  prepended  to  the  process  name in syslog
207              records, so that, for example, "smtpd" becomes "prefix/smtpd".
208
209       trigger_timeout (10s)
210              The time limit for sending a trigger to a  Postfix  daemon  (for
211              example, the pickup(8) or qmgr(8) daemon).
212
213       Available in Postfix version 2.2 and later:
214
215       authorized_flush_users (static:anyone)
216              List of users who are authorized to flush the queue.
217
218       authorized_mailq_users (static:anyone)
219              List of users who are authorized to view the queue.
220

FILES

222       /var/spool/postfix, mail queue
223

SEE ALSO

225       qmgr(8), queue manager
226       showq(8), list mail queue
227       flush(8), fast flush service
228       sendmail(1), Sendmail-compatible user interface
229       postsuper(1), privileged queue operations
230       postlogd(8), Postfix logging
231       syslogd(8), system logging
232

README FILES

234       Use  "postconf readme_directory" or "postconf html_directory" to locate
235       this information.
236       ETRN_README, Postfix ETRN howto
237

LICENSE

239       The Secure Mailer license must be distributed with this software.
240

HISTORY

242       The postqueue command was introduced with Postfix version 1.1.
243

AUTHOR(S)

245       Wietse Venema
246       IBM T.J. Watson Research
247       P.O. Box 704
248       Yorktown Heights, NY 10598, USA
249
250       Wietse Venema
251       Google, Inc.
252       111 8th Avenue
253       New York, NY 10011, USA
254
255
256
257                                                                  POSTQUEUE(1)
Impressum