postsuper.1.html revision 1.1.1.5 1 1.1 tron <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
2 1.1 tron "http://www.w3.org/TR/html4/loose.dtd">
3 1.1 tron <html> <head>
4 1.1 tron <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
5 1.1 tron <title> Postfix manual - postsuper(1) </title>
6 1.1 tron </head> <body> <pre>
7 1.1 tron POSTSUPER(1) POSTSUPER(1)
8 1.1 tron
9 1.1 tron <b>NAME</b>
10 1.1 tron postsuper - Postfix superintendent
11 1.1 tron
12 1.1 tron <b>SYNOPSIS</b>
13 1.1.1.5 christos <b>postsuper</b> [<b>-psSv</b>]
14 1.1.1.5 christos [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-d</b> <i>queue</i><b>_</b><i>id</i>]
15 1.1.1.5 christos [<b>-e</b> <i>queue</i><b>_</b><i>id</i>] [<b>-f</b> <i>queue</i><b>_</b><i>id</i>]
16 1.1 tron [<b>-h</b> <i>queue</i><b>_</b><i>id</i>] [<b>-H</b> <i>queue</i><b>_</b><i>id</i>]
17 1.1 tron [<b>-r</b> <i>queue</i><b>_</b><i>id</i>] [<i>directory ...</i>]
18 1.1 tron
19 1.1 tron <b>DESCRIPTION</b>
20 1.1.1.3 tron The <a href="postsuper.1.html"><b>postsuper</b>(1)</a> command does maintenance jobs on the Postfix queue.
21 1.1.1.3 tron Use of the command is restricted to the superuser. See the
22 1.1.1.3 tron <a href="postqueue.1.html"><b>postqueue</b>(1)</a> command for unprivileged queue operations such as listing
23 1.1.1.3 tron or flushing the mail queue.
24 1.1.1.3 tron
25 1.1.1.3 tron By default, <a href="postsuper.1.html"><b>postsuper</b>(1)</a> performs the operations requested with the <b>-s</b>
26 1.1.1.3 tron and <b>-p</b> command-line options on all Postfix queue directories - this
27 1.1.1.5 christos includes the <b>incoming</b>, <b>active</b>, <b>deferred</b>, and <b>hold</b> directories with mes-
28 1.1.1.5 christos sage files and the <b>bounce</b>, <b>defer</b>, <b>trace</b> and <b>flush</b> directories with log
29 1.1.1.5 christos files.
30 1.1 tron
31 1.1 tron Options:
32 1.1 tron
33 1.1 tron <b>-c</b> <i>config</i><b>_</b><i>dir</i>
34 1.1.1.3 tron The <a href="postconf.5.html"><b>main.cf</b></a> configuration file is in the named directory instead
35 1.1.1.3 tron of the default configuration directory. See also the MAIL_CONFIG
36 1.1.1.3 tron environment setting below.
37 1.1 tron
38 1.1 tron <b>-d</b> <i>queue</i><b>_</b><i>id</i>
39 1.1.1.5 christos Delete one message with the named queue ID from the named mail
40 1.1.1.3 tron queue(s) (default: <b>hold</b>, <b>incoming</b>, <b>active</b> and <b>deferred</b>).
41 1.1.1.3 tron
42 1.1.1.5 christos To delete multiple files, specify the <b>-d</b> option multiple times,
43 1.1.1.5 christos or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard
44 1.1.1.5 christos input. For example, to delete all mail with exactly one recipi-
45 1.1.1.5 christos ent <b>user (a] example.com</b>:
46 1.1 tron
47 1.1.1.5 christos mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" }
48 1.1 tron # $7=sender, $8=recipient1, $9=recipient2
49 1.1 tron { if ($8 == "user (a] example.com" && $9 == "")
50 1.1 tron print $1 }
51 1.1.1.5 christos ' | tr -d '*!' | postsuper -d -
52 1.1 tron
53 1.1.1.3 tron Specify "<b>-d ALL</b>" to remove all messages; for example, specify
54 1.1.1.3 tron "<b>-d ALL deferred</b>" to delete all mail in the <b>deferred</b> queue. As
55 1.1.1.3 tron a safety measure, the word <b>ALL</b> must be specified in upper case.
56 1.1.1.3 tron
57 1.1.1.3 tron Warning: Postfix queue IDs are reused (always with Postfix <=
58 1.1.1.3 tron 2.8; and with Postfix >= 2.9 when <a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a>=no).
59 1.1.1.3 tron There is a very small possibility that postsuper deletes the
60 1.1.1.3 tron wrong message file when it is executed while the Postfix mail
61 1.1.1.3 tron system is delivering mail.
62 1.1 tron
63 1.1 tron The scenario is as follows:
64 1.1 tron
65 1.1.1.3 tron 1) The Postfix queue manager deletes the message that <a href="postsuper.1.html"><b>post-</b></a>
66 1.1.1.3 tron <a href="postsuper.1.html"><b>super</b>(1)</a> is asked to delete, because Postfix is finished
67 1.1.1.3 tron with the message (it is delivered, or it is returned to
68 1.1.1.3 tron the sender).
69 1.1.1.3 tron
70 1.1.1.3 tron 2) New mail arrives, and the new message is given the same
71 1.1.1.3 tron queue ID as the message that <a href="postsuper.1.html"><b>postsuper</b>(1)</a> is supposed to
72 1.1.1.3 tron delete. The probability for reusing a deleted queue ID
73 1.1.1.3 tron is about 1 in 2**15 (the number of different microsecond
74 1.1.1.3 tron values that the system clock can distinguish within a
75 1.1.1.3 tron second).
76 1.1.1.3 tron
77 1.1.1.3 tron 3) <a href="postsuper.1.html"><b>postsuper</b>(1)</a> deletes the new message, instead of the old
78 1.1.1.3 tron message that it should have deleted.
79 1.1 tron
80 1.1.1.5 christos <b>-e</b> <i>queue</i><b>_</b><i>id</i>
81 1.1.1.5 christos
82 1.1.1.5 christos <b>-f</b> <i>queue</i><b>_</b><i>id</i>
83 1.1.1.5 christos Request forced expiration for one message with the named queue
84 1.1.1.5 christos ID in the named mail queue(s) (default: <b>hold</b>, <b>incoming</b>, <b>active</b>
85 1.1.1.5 christos and <b>deferred</b>).
86 1.1.1.5 christos
87 1.1.1.5 christos <b>o</b> The message will be returned to the sender when the queue
88 1.1.1.5 christos manager attempts to deliver that message (note that Post-
89 1.1.1.5 christos fix will never deliver messages in the <b>hold</b> queue).
90 1.1.1.5 christos
91 1.1.1.5 christos <b>o</b> The <b>-e</b> and <b>-f</b> options both request forced expiration. The
92 1.1.1.5 christos difference is that <b>-f</b> will also release a message if it
93 1.1.1.5 christos is in the <b>hold</b> queue. With <b>-e</b>, such a message would not
94 1.1.1.5 christos be returned to the sender until it is released with <b>-f</b> or
95 1.1.1.5 christos <b>-H</b>.
96 1.1.1.5 christos
97 1.1.1.5 christos <b>o</b> When a deferred message is force-expired, the return mes-
98 1.1.1.5 christos sage will state the reason for the delay. Otherwise, the
99 1.1.1.5 christos reason will be "message is administratively expired".
100 1.1.1.5 christos
101 1.1.1.5 christos To expire multiple files, specify the <b>-e</b> or <b>-f</b> option multiple
102 1.1.1.5 christos times, or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from stan-
103 1.1.1.5 christos dard input (see the <b>-d</b> option above for an example, but be sure
104 1.1.1.5 christos to replace <b>-d</b> in the example).
105 1.1.1.5 christos
106 1.1.1.5 christos Specify "<b>-e ALL</b>" or "<b>-f ALL</b>" to expire all messages; for exam-
107 1.1.1.5 christos ple, specify "<b>-e ALL deferred</b>" to expire all mail in the
108 1.1.1.5 christos <b>deferred</b> queue. As a safety measure, the word <b>ALL</b> must be spec-
109 1.1.1.5 christos ified in upper case.
110 1.1.1.5 christos
111 1.1.1.5 christos These features are available in Postfix 3.5 and later.
112 1.1.1.5 christos
113 1.1 tron <b>-h</b> <i>queue</i><b>_</b><i>id</i>
114 1.1.1.3 tron Put mail "on hold" so that no attempt is made to deliver it.
115 1.1.1.3 tron Move one message with the named queue ID from the named mail
116 1.1.1.3 tron queue(s) (default: <b>incoming</b>, <b>active</b> and <b>deferred</b>) to the <b>hold</b>
117 1.1.1.3 tron queue.
118 1.1.1.3 tron
119 1.1.1.5 christos To hold multiple files, specify the <b>-h</b> option multiple times, or
120 1.1.1.5 christos specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard input.
121 1.1.1.3 tron
122 1.1.1.3 tron Specify "<b>-h ALL</b>" to hold all messages; for example, specify "<b>-h</b>
123 1.1.1.3 tron <b>ALL deferred</b>" to hold all mail in the <b>deferred</b> queue. As a
124 1.1.1.3 tron safety measure, the word <b>ALL</b> must be specified in upper case.
125 1.1.1.3 tron
126 1.1.1.3 tron Note: while mail is "on hold" it will not expire when its time
127 1.1.1.3 tron in the queue exceeds the <b><a href="postconf.5.html#maximal_queue_lifetime">maximal_queue_lifetime</a></b> or
128 1.1.1.3 tron <b><a href="postconf.5.html#bounce_queue_lifetime">bounce_queue_lifetime</a></b> setting. It becomes subject to expiration
129 1.1.1.3 tron after it is released from "hold".
130 1.1 tron
131 1.1 tron This feature is available in Postfix 2.0 and later.
132 1.1 tron
133 1.1 tron <b>-H</b> <i>queue</i><b>_</b><i>id</i>
134 1.1.1.3 tron Release mail that was put "on hold". Move one message with the
135 1.1.1.3 tron named queue ID from the named mail queue(s) (default: <b>hold</b>) to
136 1.1.1.3 tron the <b>deferred</b> queue.
137 1.1.1.3 tron
138 1.1.1.5 christos To release multiple files, specify the <b>-H</b> option multiple times,
139 1.1.1.5 christos or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard
140 1.1.1.5 christos input.
141 1.1.1.3 tron
142 1.1.1.5 christos Note: specify "<b>postsuper -r</b>" to release mail that was kept on
143 1.1.1.5 christos hold for a significant fraction of <b>$<a href="postconf.5.html#maximal_queue_lifetime">maximal_queue_lifetime</a></b> or
144 1.1.1.3 tron <b>$<a href="postconf.5.html#bounce_queue_lifetime">bounce_queue_lifetime</a></b>, or longer.
145 1.1.1.3 tron
146 1.1.1.5 christos Specify "<b>-H ALL</b>" to release all mail that is "on hold". As a
147 1.1.1.3 tron safety measure, the word <b>ALL</b> must be specified in upper case.
148 1.1 tron
149 1.1 tron This feature is available in Postfix 2.0 and later.
150 1.1 tron
151 1.1.1.5 christos <b>-p</b> Purge old temporary files that are left over after system or
152 1.1.1.5 christos software crashes. The <b>-p</b>, <b>-s</b>, and <b>-S</b> operations are done before
153 1.1.1.5 christos other operations.
154 1.1 tron
155 1.1 tron <b>-r</b> <i>queue</i><b>_</b><i>id</i>
156 1.1.1.3 tron Requeue the message with the named queue ID from the named mail
157 1.1.1.5 christos queue(s) (default: <b>hold</b>, <b>incoming</b>, <b>active</b> and <b>deferred</b>).
158 1.1.1.3 tron
159 1.1.1.5 christos To requeue multiple files, specify the <b>-r</b> option multiple times,
160 1.1.1.5 christos or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard
161 1.1.1.5 christos input.
162 1.1.1.3 tron
163 1.1.1.5 christos Specify "<b>-r ALL</b>" to requeue all messages. As a safety measure,
164 1.1.1.3 tron the word <b>ALL</b> must be specified in upper case.
165 1.1.1.3 tron
166 1.1.1.3 tron A requeued message is moved to the <b>maildrop</b> queue, from where it
167 1.1.1.3 tron is copied by the <a href="pickup.8.html"><b>pickup</b>(8)</a> and <a href="cleanup.8.html"><b>cleanup</b>(8)</a> daemons to a new queue
168 1.1.1.5 christos file. In many respects its handling differs from that of a new
169 1.1 tron local submission.
170 1.1 tron
171 1.1.1.5 christos <b>o</b> The message is not subjected to the <a href="postconf.5.html#smtpd_milters">smtpd_milters</a> or
172 1.1.1.3 tron <a href="postconf.5.html#non_smtpd_milters">non_smtpd_milters</a> settings. When mail has passed through
173 1.1.1.5 christos an external content filter, this would produce incorrect
174 1.1.1.5 christos results with Milter applications that depend on original
175 1.1.1.3 tron SMTP connection state information.
176 1.1.1.3 tron
177 1.1.1.5 christos <b>o</b> The message is subjected again to mail address rewriting
178 1.1.1.3 tron and substitution. This is useful when rewriting rules or
179 1.1.1.3 tron virtual mappings have changed.
180 1.1.1.3 tron
181 1.1.1.5 christos The address rewriting context (local or remote) is the
182 1.1.1.3 tron same as when the message was received.
183 1.1.1.3 tron
184 1.1.1.5 christos <b>o</b> The message is subjected to the same <a href="postconf.5.html#content_filter">content_filter</a> set-
185 1.1.1.5 christos tings (if any) as used for new local mail submissions.
186 1.1.1.3 tron This is useful when <a href="postconf.5.html#content_filter">content_filter</a> settings have changed.
187 1.1.1.3 tron
188 1.1.1.5 christos Warning: Postfix queue IDs are reused (always with Postfix <=
189 1.1.1.5 christos 2.8; and with Postfix >= 2.9 when <a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a>=no).
190 1.1.1.3 tron There is a very small possibility that <a href="postsuper.1.html"><b>postsuper</b>(1)</a> requeues the
191 1.1.1.5 christos wrong message file when it is executed while the Postfix mail
192 1.1.1.3 tron system is running, but no harm should be done.
193 1.1 tron
194 1.1 tron This feature is available in Postfix 1.1 and later.
195 1.1 tron
196 1.1.1.5 christos <b>-s</b> Structure check and structure repair. This should be done once
197 1.1.1.5 christos before Postfix startup. The <b>-p</b>, <b>-s</b>, and <b>-S</b> operations are done
198 1.1.1.5 christos before other operations.
199 1.1 tron
200 1.1.1.3 tron <b>o</b> Rename files whose name does not match the message file
201 1.1.1.3 tron inode number. This operation is necessary after restoring
202 1.1.1.3 tron a mail queue from a different machine or from backup,
203 1.1.1.3 tron when queue files were created with Postfix <= 2.8 or with
204 1.1.1.3 tron "<a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a> = no".
205 1.1.1.3 tron
206 1.1.1.3 tron <b>o</b> Move queue files that are in the wrong place in the file
207 1.1.1.3 tron system hierarchy and remove subdirectories that are no
208 1.1.1.3 tron longer needed. File position rearrangements are neces-
209 1.1.1.3 tron sary after a change in the <b><a href="postconf.5.html#hash_queue_names">hash_queue_names</a></b> and/or
210 1.1 tron <b><a href="postconf.5.html#hash_queue_depth">hash_queue_depth</a></b> configuration parameters.
211 1.1 tron
212 1.1.1.3 tron <b>o</b> Rename queue files created with "<a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a> =
213 1.1.1.3 tron yes" to short names, for migration to Postfix <= 2.8.
214 1.1.1.3 tron The procedure is as follows:
215 1.1.1.2 tron
216 1.1.1.2 tron # postfix stop
217 1.1.1.2 tron # postconf <a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a>=no
218 1.1.1.2 tron # postsuper
219 1.1.1.2 tron
220 1.1.1.3 tron Run <a href="postsuper.1.html"><b>postsuper</b>(1)</a> repeatedly until it stops reporting file
221 1.1.1.3 tron name changes.
222 1.1.1.3 tron
223 1.1.1.3 tron <b>-S</b> A redundant version of <b>-s</b> that requires that long file names
224 1.1.1.3 tron also match the message file inode number. This option exists for
225 1.1.1.5 christos testing purposes, and is available with Postfix 2.9 and later.
226 1.1.1.5 christos The <b>-p</b>, <b>-s</b>, and <b>-S</b> operations are done before other operations.
227 1.1.1.2 tron
228 1.1.1.3 tron <b>-v</b> Enable verbose logging for debugging purposes. Multiple <b>-v</b>
229 1.1.1.3 tron options make the software increasingly verbose.
230 1.1 tron
231 1.1 tron <b>DIAGNOSTICS</b>
232 1.1.1.5 christos Problems are reported to the standard error stream and to <b>syslogd</b>(8) or
233 1.1.1.5 christos <a href="postlogd.8.html"><b>postlogd</b>(8)</a>.
234 1.1 tron
235 1.1.1.3 tron <a href="postsuper.1.html"><b>postsuper</b>(1)</a> reports the number of messages deleted with <b>-d</b>, the number
236 1.1.1.5 christos of messages expired with <b>-e</b>, the number of messages expired or released
237 1.1.1.5 christos with <b>-f</b>, the number of messages held or released with <b>-h</b> or <b>-H</b>, the
238 1.1.1.5 christos number of messages requeued with <b>-r</b>, and the number of messages whose
239 1.1.1.5 christos queue file name was fixed with <b>-s</b>. The report is written to the stan-
240 1.1.1.5 christos dard error stream and to <b>syslogd</b>(8) or <a href="postlogd.8.html"><b>postlogd</b>(8)</a>.
241 1.1 tron
242 1.1 tron <b>ENVIRONMENT</b>
243 1.1 tron MAIL_CONFIG
244 1.1 tron Directory with the <a href="postconf.5.html"><b>main.cf</b></a> file.
245 1.1 tron
246 1.1 tron <b>BUGS</b>
247 1.1.1.3 tron Mail that is not sanitized by Postfix (i.e. mail in the <b>maildrop</b> queue)
248 1.1.1.3 tron cannot be placed "on hold".
249 1.1 tron
250 1.1 tron <b>CONFIGURATION PARAMETERS</b>
251 1.1.1.5 christos The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant to this pro-
252 1.1.1.5 christos gram. The text below provides only a parameter summary. See <a href="postconf.5.html"><b>post-</b></a>
253 1.1.1.3 tron <a href="postconf.5.html"><b>conf</b>(5)</a> for more details including examples.
254 1.1 tron
255 1.1 tron <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
256 1.1.1.5 christos The default location of the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> con-
257 1.1.1.3 tron figuration files.
258 1.1 tron
259 1.1 tron <b><a href="postconf.5.html#hash_queue_depth">hash_queue_depth</a> (1)</b>
260 1.1.1.5 christos The number of subdirectory levels for queue directories listed
261 1.1.1.3 tron with the <a href="postconf.5.html#hash_queue_names">hash_queue_names</a> parameter.
262 1.1 tron
263 1.1 tron <b><a href="postconf.5.html#hash_queue_names">hash_queue_names</a> (deferred, defer)</b>
264 1.1.1.5 christos The names of queue directories that are split across multiple
265 1.1.1.3 tron subdirectory levels.
266 1.1 tron
267 1.1.1.5 christos <b><a href="postconf.5.html#import_environment">import_environment</a> (see 'postconf -d' output)</b>
268 1.1.1.5 christos The list of environment parameters that a privileged Postfix
269 1.1.1.5 christos process will import from a non-Postfix parent process, or
270 1.1.1.5 christos name=value environment overrides.
271 1.1.1.5 christos
272 1.1 tron <b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
273 1.1.1.3 tron The location of the Postfix top-level queue directory.
274 1.1 tron
275 1.1 tron <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
276 1.1 tron The syslog facility of Postfix logging.
277 1.1 tron
278 1.1 tron <b><a href="postconf.5.html#syslog_name">syslog_name</a> (see 'postconf -d' output)</b>
279 1.1.1.5 christos A prefix that is prepended to the process name in syslog
280 1.1.1.5 christos records, so that, for example, "smtpd" becomes "prefix/smtpd".
281 1.1 tron
282 1.1.1.2 tron Available in Postfix version 2.9 and later:
283 1.1.1.2 tron
284 1.1.1.2 tron <b><a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a> (no)</b>
285 1.1.1.3 tron Enable long, non-repeating, queue IDs (queue file names).
286 1.1.1.2 tron
287 1.1 tron <b>SEE ALSO</b>
288 1.1 tron <a href="sendmail.1.html">sendmail(1)</a>, Sendmail-compatible user interface
289 1.1 tron <a href="postqueue.1.html">postqueue(1)</a>, unprivileged queue operations
290 1.1.1.5 christos <a href="postlogd.8.html">postlogd(8)</a>, Postfix logging
291 1.1.1.5 christos syslogd(8), system logging
292 1.1 tron
293 1.1 tron <b>LICENSE</b>
294 1.1.1.3 tron The Secure Mailer license must be distributed with this software.
295 1.1 tron
296 1.1 tron <b>AUTHOR(S)</b>
297 1.1 tron Wietse Venema
298 1.1 tron IBM T.J. Watson Research
299 1.1 tron P.O. Box 704
300 1.1 tron Yorktown Heights, NY 10598, USA
301 1.1 tron
302 1.1.1.4 christos Wietse Venema
303 1.1.1.4 christos Google, Inc.
304 1.1.1.4 christos 111 8th Avenue
305 1.1.1.4 christos New York, NY 10011, USA
306 1.1.1.4 christos
307 1.1 tron POSTSUPER(1)
308 1.1 tron </pre> </body> </html>
309