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