1POSTSUPER(1)                General Commands Manual               POSTSUPER(1)
2
3
4

NAME

6       postsuper - Postfix superintendent
7

SYNOPSIS

9       postsuper [-psSv] [-c config_dir] [-d queue_id]
10               [-h queue_id] [-H queue_id]
11               [-r queue_id] [directory ...]
12

DESCRIPTION

14       The  postsuper(1)  command  does maintenance jobs on the Postfix queue.
15       Use  of  the  command  is  restricted  to  the  superuser.    See   the
16       postqueue(1)  command for unprivileged queue operations such as listing
17       or flushing the mail queue.
18
19       By default, postsuper(1) performs the operations requested with the  -s
20       and  -p  command-line  options  on all Postfix queue directories - this
21       includes the incoming, active and deferred directories with mail  files
22       and the bounce, defer, trace and flush directories with log files.
23
24       Options:
25
26       -c config_dir
27              The main.cf configuration file is in the named directory instead
28              of the default configuration directory. See also the MAIL_CONFIG
29              environment setting below.
30
31       -d queue_id
32              Delete  one  message with the named queue ID from the named mail
33              queue(s) (default: hold, incoming, active and deferred).
34
35              To delete multiple files, specify the -d option multiple  times,
36              or  specify  a  queue_id  of  -  to read queue IDs from standard
37              input. For example, to delete all mail with exactly one  recipi‐
38              ent user@example.com:
39
40              mailq | tail -n +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" }
41                  # $7=sender, $8=recipient1, $9=recipient2
42                  { if ($8 == "user@example.com" && $9 == "")
43                        print $1 }
44               ' | tr -d '*!' | postsuper -d -
45
46              Specify  "-d  ALL"  to remove all messages; for example, specify
47              "-d ALL deferred" to delete all mail in the deferred queue.   As
48              a safety measure, the word ALL must be specified in upper case.
49
50              Warning:  Postfix  queue  IDs are reused (always with Postfix <=
51              2.8; and with Postfix  >=  2.9  when  enable_long_queue_ids=no).
52              There  is  a  very  small possibility that postsuper deletes the
53              wrong message file when it is executed while  the  Postfix  mail
54              system is delivering mail.
55
56              The scenario is as follows:
57
58              1)     The  Postfix queue manager deletes the message that post‐
59                     super(1) is asked to delete, because Postfix is  finished
60                     with  the  message (it is delivered, or it is returned to
61                     the sender).
62
63              2)     New mail arrives, and the new message is given  the  same
64                     queue  ID as the message that postsuper(1) is supposed to
65                     delete.  The probability for reusing a deleted  queue  ID
66                     is  about 1 in 2**15 (the number of different microsecond
67                     values that the system clock  can  distinguish  within  a
68                     second).
69
70              3)     postsuper(1)  deletes the new message, instead of the old
71                     message that it should have deleted.
72
73       -h queue_id
74              Put mail "on hold" so that no attempt is  made  to  deliver  it.
75              Move  one  message  with  the named queue ID from the named mail
76              queue(s) (default: incoming, active and deferred)  to  the  hold
77              queue.
78
79              To hold multiple files, specify the -h option multiple times, or
80              specify a queue_id of - to read queue IDs from standard input.
81
82              Specify "-h ALL" to hold all messages; for example, specify  "-h
83              ALL  deferred"  to  hold  all  mail in the deferred queue.  As a
84              safety measure, the word ALL must be specified in upper case.
85
86              Note: while mail is "on hold" it will not expire when  its  time
87              in    the    queue   exceeds   the   maximal_queue_lifetime   or
88              bounce_queue_lifetime setting. It becomes subject to  expiration
89              after it is released from "hold".
90
91              This feature is available in Postfix 2.0 and later.
92
93       -H queue_id
94              Release  mail that was put "on hold".  Move one message with the
95              named queue ID from the named mail queue(s) (default:  hold)  to
96              the deferred queue.
97
98              To release multiple files, specify the -H option multiple times,
99              or specify a queue_id of -  to  read  queue  IDs  from  standard
100              input.
101
102              Note:  specify  "postsuper  -r" to release mail that was kept on
103              hold for a significant fraction  of  $maximal_queue_lifetime  or
104              $bounce_queue_lifetime, or longer.
105
106              Specify  "-H  ALL"  to release all mail that is "on hold".  As a
107              safety measure, the word ALL must be specified in upper case.
108
109              This feature is available in Postfix 2.0 and later.
110
111       -p     Purge old temporary files that are left  over  after  system  or
112              software crashes.
113
114       -r queue_id
115              Requeue  the message with the named queue ID from the named mail
116              queue(s) (default: hold, incoming, active and deferred).
117
118              To requeue multiple files, specify the -r option multiple times,
119              or  specify  a  queue_id  of  -  to read queue IDs from standard
120              input.
121
122              Specify "-r ALL" to requeue all messages. As a  safety  measure,
123              the word ALL must be specified in upper case.
124
125              A requeued message is moved to the maildrop queue, from where it
126              is copied by the pickup(8) and cleanup(8) daemons to a new queue
127              file.  In  many respects its handling differs from that of a new
128              local submission.
129
130              ·      The message is not  subjected  to  the  smtpd_milters  or
131                     non_smtpd_milters settings.  When mail has passed through
132                     an external content filter, this would produce  incorrect
133                     results  with Milter applications that depend on original
134                     SMTP connection state information.
135
136              ·      The message is subjected again to mail address  rewriting
137                     and substitution.  This is useful when rewriting rules or
138                     virtual mappings have changed.
139
140                     The address rewriting context (local or  remote)  is  the
141                     same as when the message was received.
142
143              ·      The  message is subjected to the same content_filter set‐
144                     tings (if any) as used for new  local  mail  submissions.
145                     This is useful when content_filter settings have changed.
146
147              Warning:  Postfix  queue  IDs are reused (always with Postfix <=
148              2.8; and with Postfix  >=  2.9  when  enable_long_queue_ids=no).
149              There is a very small possibility that postsuper(1) requeues the
150              wrong message file when it is executed while  the  Postfix  mail
151              system is running, but no harm should be done.
152
153              This feature is available in Postfix 1.1 and later.
154
155       -s     Structure  check and structure repair.  This should be done once
156              before Postfix startup.
157
158              ·      Rename files whose name does not match the  message  file
159                     inode number. This operation is necessary after restoring
160                     a mail queue from a different  machine  or  from  backup,
161                     when queue files were created with Postfix <= 2.8 or with
162                     "enable_long_queue_ids = no".
163
164              ·      Move queue files that are in the wrong place in the  file
165                     system  hierarchy  and  remove subdirectories that are no
166                     longer needed.  File position rearrangements  are  neces‐
167                     sary  after  a  change  in  the  hash_queue_names  and/or
168                     hash_queue_depth configuration parameters.
169
170              ·      Rename queue files created with "enable_long_queue_ids  =
171                     yes"  to  short  names,  for migration to Postfix <= 2.8.
172                     The procedure is as follows:
173
174                     # postfix stop
175                     # postconf enable_long_queue_ids=no
176                     # postsuper
177
178                     Run postsuper(1) repeatedly until it stops reporting file
179                     name changes.
180
181       -S     A  redundant  version  of  -s that requires that long file names
182              also match the message file inode number. This option exists for
183              testing purposes, and is available with Postfix 2.9 and later.
184
185       -v     Enable  verbose  logging  for  debugging  purposes.  Multiple -v
186              options make the software increasingly verbose.
187

DIAGNOSTICS

189       Problems are reported to the standard error stream and to syslogd(8).
190
191       postsuper(1) reports the number of messages deleted with -d, the number
192       of  messages  requeued  with -r, and the number of messages whose queue
193       file name was fixed with -s. The report  is  written  to  the  standard
194       error stream and to syslogd(8).
195

ENVIRONMENT

197       MAIL_CONFIG
198              Directory with the main.cf file.
199

BUGS

201       Mail that is not sanitized by Postfix (i.e. mail in the maildrop queue)
202       cannot be placed "on hold".
203

CONFIGURATION PARAMETERS

205       The following main.cf parameters are especially relevant to  this  pro‐
206       gram.   The  text  below  provides  only a parameter summary. See post‐
207       conf(5) for more details including examples.
208
209       config_directory (see 'postconf -d' output)
210              The default location of the Postfix main.cf and  master.cf  con‐
211              figuration files.
212
213       hash_queue_depth (1)
214              The  number  of subdirectory levels for queue directories listed
215              with the hash_queue_names parameter.
216
217       hash_queue_names (deferred, defer)
218              The names of queue directories that are  split  across  multiple
219              subdirectory levels.
220
221       import_environment (see 'postconf -d' output)
222              The  list  of  environment  parameters that a privileged Postfix
223              process will  import  from  a  non-Postfix  parent  process,  or
224              name=value environment overrides.
225
226       queue_directory (see 'postconf -d' output)
227              The location of the Postfix top-level queue directory.
228
229       syslog_facility (mail)
230              The syslog facility of Postfix logging.
231
232       syslog_name (see 'postconf -d' output)
233              A  prefix  that  is  prepended  to  the  process  name in syslog
234              records, so that, for example, "smtpd" becomes "prefix/smtpd".
235
236       Available in Postfix version 2.9 and later:
237
238       enable_long_queue_ids (no)
239              Enable long, non-repeating, queue IDs (queue file names).
240

SEE ALSO

242       sendmail(1), Sendmail-compatible user interface
243       postqueue(1), unprivileged queue operations
244

LICENSE

246       The Secure Mailer license must be distributed with this software.
247

AUTHOR(S)

249       Wietse Venema
250       IBM T.J. Watson Research
251       P.O. Box 704
252       Yorktown Heights, NY 10598, USA
253
254       Wietse Venema
255       Google, Inc.
256       111 8th Avenue
257       New York, NY 10011, USA
258
259
260
261                                                                  POSTSUPER(1)
Impressum