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