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