summaryrefslogtreecommitdiffstats
path: root/man/man1/postqueue.1
blob: c8020c192d676c9aceeb3b85af02165ccec06cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
.TH POSTQUEUE 1 
.ad
.fi
.SH NAME
postqueue
\-
Postfix queue control
.SH "SYNOPSIS"
.na
.nf
.ti -4
\fBTo flush the mail queue\fR:

\fBpostqueue\fR [\fB\-v\fR] [\fB\-c \fIconfig_dir\fR] \fB\-f\fR

\fBpostqueue\fR [\fB\-v\fR] [\fB\-c \fIconfig_dir\fR] \fB\-i \fIqueue_id\fR

\fBpostqueue\fR [\fB\-v\fR] [\fB\-c \fIconfig_dir\fR] \fB\-s \fIsite\fR

.ti -4
\fBTo list the mail queue\fR:

\fBpostqueue\fR [\fB\-v\fR] [\fB\-c \fIconfig_dir\fR] \fB\-j\fR

\fBpostqueue\fR [\fB\-v\fR] [\fB\-c \fIconfig_dir\fR] \fB\-p\fR
.SH DESCRIPTION
.ad
.fi
The \fBpostqueue\fR(1) command implements the Postfix user interface
for queue management. It implements operations that are
traditionally available via the \fBsendmail\fR(1) command.
See the \fBpostsuper\fR(1) 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:
.IP "\fB\-c \fIconfig_dir\fR"
The \fBmain.cf\fR configuration file is in the named directory
instead of the default configuration directory. See also the
MAIL_CONFIG environment setting below.
.IP \fB\-f\fR
Flush the queue: attempt to deliver all queued mail.

This option implements the traditional "\fBsendmail \-q\fR" command,
by contacting the Postfix \fBqmgr\fR(8) daemon.

Warning: flushing undeliverable mail frequently will result in
poor delivery performance of all other mail.
.IP "\fB\-i \fIqueue_id\fR"
Schedule immediate delivery of deferred mail with the
specified queue ID.

This option implements the traditional \fBsendmail \-qI\fR
command, by contacting the \fBflush\fR(8) server.

This feature is available with Postfix version 2.4 and later.
.IP "\fB\-j\fR"
Produce a queue listing in JSON format, based on output
from the showq(8) daemon.  The 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 "\fBJSON OBJECT FORMAT\fR" below for details.

This feature is available in Postfix 3.1 and later.
.IP \fB\-p\fR
Produce a traditional sendmail\-style queue listing.
This option implements the traditional \fBmailq\fR command,
by contacting the Postfix \fBshowq\fR(8) 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:
.RS
.IP \fB*\fR
The message is in the \fBactive\fR queue, i.e. the message is
selected for delivery.
.IP \fB!\fR
The message is in the \fBhold\fR queue, i.e. no further delivery
attempt will be made until the mail is taken off hold.
.IP \fB#\fR
The message is forced to expire. See the \fBpostsuper\fR(1)
options \fB\-e\fR or \fB\-f\fR.
.sp
This feature is available in Postfix 3.5 and later.
.RE
.IP "\fB\-s \fIsite\fR"
Schedule immediate delivery of all mail that is queued for the named
\fIsite\fR. 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 \fBflush\fR(8) for more information about the "fast flush"
service.

This option implements the traditional "\fBsendmail \-qR\fIsite\fR"
command, by contacting the Postfix \fBflush\fR(8) daemon.
.IP \fB\-v\fR
Enable verbose logging for debugging purposes. Multiple \fB\-v\fR
options make the software increasingly verbose. As of Postfix 2.3,
this option is available for the super\-user only.
.SH "JSON OBJECT FORMAT"
.na
.nf
.ad
.fi
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.
.IP \fBqueue_name\fR
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.
.IP \fBqueue_id\fR
The queue file name. The queue_id may be reused within a
Postfix instance unless "enable_long_queue_ids = true" and
time is monotonic.  Even then, the queue_id is not expected
to be unique between different Postfix instances.  Management
tools that require a unique name should combine the queue_id
with the myhostname setting of the Postfix instance.
.IP \fBarrival_time\fR
The number of seconds since the start of the UNIX epoch.
.IP \fBmessage_size\fR
The number of bytes in the message header and body. This
number does not include message envelope information. It
is approximately equal to the number of bytes that would
be transmitted via SMTP including the <CR><LF> line endings.
.IP \fBforced_expire\fR
The message is forced to expire (\fBtrue\fR or \fBfalse\fR).
See the \fBpostsuper\fR(1) options \fB\-e\fR or \fB\-f\fR.
.sp
This feature is available in Postfix 3.5 and later.
.IP \fBsender\fR
The envelope sender address.
.IP \fBrecipients\fR
An array containing zero or more objects with members:
.RS
.IP \fBaddress\fR
One recipient address.
.IP \fBdelay_reason\fR
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.
.RE
.SH "SECURITY"
.na
.nf
.ad
.fi
This program is designed to run with set\-group ID privileges, so
that it can connect to Postfix daemon processes.
.SH "STANDARDS"
.na
.nf
RFC 7159 (JSON notation)
.SH DIAGNOSTICS
.ad
.fi
Problems are logged to \fBsyslogd\fR(8) or \fBpostlogd\fR(8),
and to the standard error stream.
.SH "ENVIRONMENT"
.na
.nf
.ad
.fi
.IP MAIL_CONFIG
Directory with the \fBmain.cf\fR file. In order to avoid exploitation
of set\-group ID privileges, a non\-standard directory is allowed only
if:
.RS
.IP \(bu
The name is listed in the standard \fBmain.cf\fR file with the
\fBalternate_config_directories\fR configuration parameter.
.IP \(bu
The command is invoked by the super\-user.
.RE
.SH "CONFIGURATION PARAMETERS"
.na
.nf
.ad
.fi
The following \fBmain.cf\fR parameters are especially relevant to
this program.
The text below provides only a parameter summary. See
\fBpostconf\fR(5) for more details including examples.
.IP "\fBalternate_config_directories (empty)\fR"
A list of non\-default Postfix configuration directories that may
be specified with "\-c config_directory" on the command line (in the
case of \fBsendmail\fR(1), with the "\-C" option), or via the MAIL_CONFIG
environment parameter.
.IP "\fBconfig_directory (see 'postconf -d' output)\fR"
The default location of the Postfix main.cf and master.cf
configuration files.
.IP "\fBcommand_directory (see 'postconf -d' output)\fR"
The location of all postfix administrative commands.
.IP "\fBfast_flush_domains ($relay_domains)\fR"
Optional list of destinations that are eligible for per\-destination
logfiles with mail that is queued to those destinations.
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
The list of environment variables that a privileged Postfix
process will import from a non\-Postfix parent process, or name=value
environment overrides.
.IP "\fBqueue_directory (see 'postconf -d' output)\fR"
The location of the Postfix top\-level queue directory.
.IP "\fBsyslog_facility (mail)\fR"
The syslog facility of Postfix logging.
.IP "\fBsyslog_name (see 'postconf -d' output)\fR"
A prefix that is prepended to the process name in syslog
records, so that, for example, "smtpd" becomes "prefix/smtpd".
.IP "\fBtrigger_timeout (10s)\fR"
The time limit for sending a trigger to a Postfix daemon (for
example, the \fBpickup\fR(8) or \fBqmgr\fR(8) daemon).
.PP
Available in Postfix version 2.2 and later:
.IP "\fBauthorized_flush_users (static:anyone)\fR"
List of users who are authorized to flush the queue.
.IP "\fBauthorized_mailq_users (static:anyone)\fR"
List of users who are authorized to view the queue.
.SH "FILES"
.na
.nf
/var/spool/postfix, mail queue
.SH "SEE ALSO"
.na
.nf
qmgr(8), queue manager
showq(8), list mail queue
flush(8), fast flush service
sendmail(1), Sendmail\-compatible user interface
postsuper(1), privileged queue operations
postlogd(8), Postfix logging
syslogd(8), system logging
.SH "README FILES"
.na
.nf
.ad
.fi
Use "\fBpostconf readme_directory\fR" or
"\fBpostconf html_directory\fR" to locate this information.
.na
.nf
ETRN_README, Postfix ETRN howto
.SH "LICENSE"
.na
.nf
.ad
.fi
The Secure Mailer license must be distributed with this software.
.SH HISTORY
.ad
.fi
.ad
.fi
The postqueue command was introduced with Postfix version 1.1.
.SH "AUTHOR(S)"
.na
.nf
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