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 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
189 Problems are reported to the standard error stream and to syslogd(8) or
190 postlogd(8).
191
192 postsuper(1) reports the number of messages deleted with -d, the number
193 of messages requeued with -r, and the number of messages whose queue
194 file name was fixed with -s. The report is written to the standard
195 error stream and to syslogd(8) or postlogd(8).
196
198 MAIL_CONFIG
199 Directory with the main.cf file.
200
202 Mail that is not sanitized by Postfix (i.e. mail in the maildrop queue)
203 cannot be placed "on hold".
204
206 The following main.cf parameters are especially relevant to this pro‐
207 gram. The text below provides only a parameter summary. See post‐
208 conf(5) for more details including examples.
209
210 config_directory (see 'postconf -d' output)
211 The default location of the Postfix main.cf and master.cf con‐
212 figuration files.
213
214 hash_queue_depth (1)
215 The number of subdirectory levels for queue directories listed
216 with the hash_queue_names parameter.
217
218 hash_queue_names (deferred, defer)
219 The names of queue directories that are split across multiple
220 subdirectory levels.
221
222 import_environment (see 'postconf -d' output)
223 The list of environment parameters that a privileged Postfix
224 process will import from a non-Postfix parent process, or
225 name=value environment overrides.
226
227 queue_directory (see 'postconf -d' output)
228 The location of the Postfix top-level queue directory.
229
230 syslog_facility (mail)
231 The syslog facility of Postfix logging.
232
233 syslog_name (see 'postconf -d' output)
234 A prefix that is prepended to the process name in syslog
235 records, so that, for example, "smtpd" becomes "prefix/smtpd".
236
237 Available in Postfix version 2.9 and later:
238
239 enable_long_queue_ids (no)
240 Enable long, non-repeating, queue IDs (queue file names).
241
243 sendmail(1), Sendmail-compatible user interface
244 postqueue(1), unprivileged queue operations
245 postlogd(8), Postfix logging
246 syslogd(8), system logging
247
249 The Secure Mailer license must be distributed with this software.
250
252 Wietse Venema
253 IBM T.J. Watson Research
254 P.O. Box 704
255 Yorktown Heights, NY 10598, USA
256
257 Wietse Venema
258 Google, Inc.
259 111 8th Avenue
260 New York, NY 10011, USA
261
262
263
264 POSTSUPER(1)