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