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