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