1 1.1 tron <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 1.1.1.8 christos "https://www.w3.org/TR/html4/loose.dtd"> 3 1.1 tron <html> <head> 4 1.1.1.6 christos <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 1.1.1.7 christos <link rel='stylesheet' type='text/css' href='postfix-doc.css'> 6 1.1 tron <title> Postfix manual - postsuper(1) </title> 7 1.1 tron </head> <body> <pre> 8 1.1 tron POSTSUPER(1) POSTSUPER(1) 9 1.1 tron 10 1.1.1.8 christos <b><a name="name">NAME</a></b> 11 1.1 tron postsuper - Postfix superintendent 12 1.1 tron 13 1.1.1.8 christos <b><a name="synopsis">SYNOPSIS</a></b> 14 1.1.1.5 christos <b>postsuper</b> [<b>-psSv</b>] 15 1.1.1.5 christos [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-d</b> <i>queue</i><b>_</b><i>id</i>] 16 1.1.1.5 christos [<b>-e</b> <i>queue</i><b>_</b><i>id</i>] [<b>-f</b> <i>queue</i><b>_</b><i>id</i>] 17 1.1 tron [<b>-h</b> <i>queue</i><b>_</b><i>id</i>] [<b>-H</b> <i>queue</i><b>_</b><i>id</i>] 18 1.1 tron [<b>-r</b> <i>queue</i><b>_</b><i>id</i>] [<i>directory ...</i>] 19 1.1 tron 20 1.1.1.8 christos <b><a name="description">DESCRIPTION</a></b> 21 1.1.1.3 tron The <a href="postsuper.1.html"><b>postsuper</b>(1)</a> command does maintenance jobs on the Postfix queue. 22 1.1.1.3 tron Use of the command is restricted to the superuser. See the 23 1.1.1.3 tron <a href="postqueue.1.html"><b>postqueue</b>(1)</a> command for unprivileged queue operations such as listing 24 1.1.1.3 tron or flushing the mail queue. 25 1.1.1.3 tron 26 1.1.1.3 tron By default, <a href="postsuper.1.html"><b>postsuper</b>(1)</a> performs the operations requested with the <b>-s</b> 27 1.1.1.3 tron and <b>-p</b> command-line options on all Postfix queue directories - this 28 1.1.1.5 christos includes the <b>incoming</b>, <b>active</b>, <b>deferred</b>, and <b>hold</b> directories with mes- 29 1.1.1.5 christos sage files and the <b>bounce</b>, <b>defer</b>, <b>trace</b> and <b>flush</b> directories with log 30 1.1.1.5 christos files. 31 1.1 tron 32 1.1 tron Options: 33 1.1 tron 34 1.1 tron <b>-c</b> <i>config</i><b>_</b><i>dir</i> 35 1.1.1.3 tron The <a href="postconf.5.html"><b>main.cf</b></a> configuration file is in the named directory instead 36 1.1.1.3 tron of the default configuration directory. See also the MAIL_CONFIG 37 1.1.1.3 tron environment setting below. 38 1.1 tron 39 1.1 tron <b>-d</b> <i>queue</i><b>_</b><i>id</i> 40 1.1.1.5 christos Delete one message with the named queue ID from the named mail 41 1.1.1.3 tron queue(s) (default: <b>hold</b>, <b>incoming</b>, <b>active</b> and <b>deferred</b>). 42 1.1.1.3 tron 43 1.1.1.5 christos To delete multiple files, specify the <b>-d</b> option multiple times, 44 1.1.1.5 christos or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard 45 1.1.1.5 christos input. For example, to delete all mail with exactly one recipi- 46 1.1.1.5 christos ent <b>user (a] example.com</b>: 47 1.1 tron 48 1.1.1.6 christos postqueue -j | jq -r ' 49 1.1.1.6 christos # See JSON OBJECT FORMAT section in the <a href="postqueue.1.html">postqueue(1)</a> manpage 50 1.1.1.6 christos select(.recipients[0].address == "user (a] example.com") 51 1.1.1.6 christos | select(.recipients[1].address == null) 52 1.1.1.6 christos | .queue_id 53 1.1.1.6 christos ' | postsuper -d - 54 1.1.1.6 christos 55 1.1.1.6 christos (note the "jq -r" option), or the historical form: 56 1.1.1.6 christos 57 1.1.1.5 christos mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } 58 1.1 tron # $7=sender, $8=recipient1, $9=recipient2 59 1.1 tron { if ($8 == "user (a] example.com" && $9 == "") 60 1.1 tron print $1 } 61 1.1.1.5 christos ' | tr -d '*!' | postsuper -d - 62 1.1 tron 63 1.1.1.3 tron Specify "<b>-d ALL</b>" to remove all messages; for example, specify 64 1.1.1.3 tron "<b>-d ALL deferred</b>" to delete all mail in the <b>deferred</b> queue. As 65 1.1.1.3 tron a safety measure, the word <b>ALL</b> must be specified in upper case. 66 1.1.1.3 tron 67 1.1.1.3 tron Warning: Postfix queue IDs are reused (always with Postfix <= 68 1.1.1.3 tron 2.8; and with Postfix >= 2.9 when <a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a>=no). 69 1.1.1.3 tron There is a very small possibility that postsuper deletes the 70 1.1.1.3 tron wrong message file when it is executed while the Postfix mail 71 1.1.1.3 tron system is delivering mail. 72 1.1 tron 73 1.1 tron The scenario is as follows: 74 1.1 tron 75 1.1.1.3 tron 1) The Postfix queue manager deletes the message that <a href="postsuper.1.html"><b>post-</b></a> 76 1.1.1.3 tron <a href="postsuper.1.html"><b>super</b>(1)</a> is asked to delete, because Postfix is finished 77 1.1.1.3 tron with the message (it is delivered, or it is returned to 78 1.1.1.3 tron the sender). 79 1.1.1.3 tron 80 1.1.1.3 tron 2) New mail arrives, and the new message is given the same 81 1.1.1.3 tron queue ID as the message that <a href="postsuper.1.html"><b>postsuper</b>(1)</a> is supposed to 82 1.1.1.3 tron delete. The probability for reusing a deleted queue ID 83 1.1.1.3 tron is about 1 in 2**15 (the number of different microsecond 84 1.1.1.3 tron values that the system clock can distinguish within a 85 1.1.1.3 tron second). 86 1.1.1.3 tron 87 1.1.1.3 tron 3) <a href="postsuper.1.html"><b>postsuper</b>(1)</a> deletes the new message, instead of the old 88 1.1.1.3 tron message that it should have deleted. 89 1.1 tron 90 1.1.1.5 christos <b>-e</b> <i>queue</i><b>_</b><i>id</i> 91 1.1.1.5 christos 92 1.1.1.5 christos <b>-f</b> <i>queue</i><b>_</b><i>id</i> 93 1.1.1.5 christos Request forced expiration for one message with the named queue 94 1.1.1.5 christos ID in the named mail queue(s) (default: <b>hold</b>, <b>incoming</b>, <b>active</b> 95 1.1.1.5 christos and <b>deferred</b>). 96 1.1.1.5 christos 97 1.1.1.5 christos <b>o</b> The message will be returned to the sender when the queue 98 1.1.1.5 christos manager attempts to deliver that message (note that Post- 99 1.1.1.5 christos fix will never deliver messages in the <b>hold</b> queue). 100 1.1.1.5 christos 101 1.1.1.5 christos <b>o</b> The <b>-e</b> and <b>-f</b> options both request forced expiration. The 102 1.1.1.5 christos difference is that <b>-f</b> will also release a message if it 103 1.1.1.5 christos is in the <b>hold</b> queue. With <b>-e</b>, such a message would not 104 1.1.1.5 christos be returned to the sender until it is released with <b>-f</b> or 105 1.1.1.5 christos <b>-H</b>. 106 1.1.1.5 christos 107 1.1.1.5 christos <b>o</b> When a deferred message is force-expired, the return mes- 108 1.1.1.5 christos sage will state the reason for the delay. Otherwise, the 109 1.1.1.5 christos reason will be "message is administratively expired". 110 1.1.1.5 christos 111 1.1.1.5 christos To expire multiple files, specify the <b>-e</b> or <b>-f</b> option multiple 112 1.1.1.5 christos times, or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from stan- 113 1.1.1.5 christos dard input (see the <b>-d</b> option above for an example, but be sure 114 1.1.1.5 christos to replace <b>-d</b> in the example). 115 1.1.1.5 christos 116 1.1.1.5 christos Specify "<b>-e ALL</b>" or "<b>-f ALL</b>" to expire all messages; for exam- 117 1.1.1.5 christos ple, specify "<b>-e ALL deferred</b>" to expire all mail in the 118 1.1.1.5 christos <b>deferred</b> queue. As a safety measure, the word <b>ALL</b> must be spec- 119 1.1.1.5 christos ified in upper case. 120 1.1.1.5 christos 121 1.1.1.5 christos These features are available in Postfix 3.5 and later. 122 1.1.1.5 christos 123 1.1 tron <b>-h</b> <i>queue</i><b>_</b><i>id</i> 124 1.1.1.3 tron Put mail "on hold" so that no attempt is made to deliver it. 125 1.1.1.3 tron Move one message with the named queue ID from the named mail 126 1.1.1.3 tron queue(s) (default: <b>incoming</b>, <b>active</b> and <b>deferred</b>) to the <b>hold</b> 127 1.1.1.3 tron queue. 128 1.1.1.3 tron 129 1.1.1.5 christos To hold multiple files, specify the <b>-h</b> option multiple times, or 130 1.1.1.5 christos specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard input. 131 1.1.1.3 tron 132 1.1.1.3 tron Specify "<b>-h ALL</b>" to hold all messages; for example, specify "<b>-h</b> 133 1.1.1.3 tron <b>ALL deferred</b>" to hold all mail in the <b>deferred</b> queue. As a 134 1.1.1.3 tron safety measure, the word <b>ALL</b> must be specified in upper case. 135 1.1.1.3 tron 136 1.1.1.3 tron Note: while mail is "on hold" it will not expire when its time 137 1.1.1.3 tron in the queue exceeds the <b><a href="postconf.5.html#maximal_queue_lifetime">maximal_queue_lifetime</a></b> or 138 1.1.1.3 tron <b><a href="postconf.5.html#bounce_queue_lifetime">bounce_queue_lifetime</a></b> setting. It becomes subject to expiration 139 1.1.1.3 tron after it is released from "hold". 140 1.1 tron 141 1.1 tron This feature is available in Postfix 2.0 and later. 142 1.1 tron 143 1.1 tron <b>-H</b> <i>queue</i><b>_</b><i>id</i> 144 1.1.1.3 tron Release mail that was put "on hold". Move one message with the 145 1.1.1.3 tron named queue ID from the named mail queue(s) (default: <b>hold</b>) to 146 1.1.1.3 tron the <b>deferred</b> queue. 147 1.1.1.3 tron 148 1.1.1.5 christos To release multiple files, specify the <b>-H</b> option multiple times, 149 1.1.1.5 christos or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard 150 1.1.1.5 christos input. 151 1.1.1.3 tron 152 1.1.1.5 christos Note: specify "<b>postsuper -r</b>" to release mail that was kept on 153 1.1.1.5 christos hold for a significant fraction of <b>$<a href="postconf.5.html#maximal_queue_lifetime">maximal_queue_lifetime</a></b> or 154 1.1.1.3 tron <b>$<a href="postconf.5.html#bounce_queue_lifetime">bounce_queue_lifetime</a></b>, or longer. 155 1.1.1.3 tron 156 1.1.1.5 christos Specify "<b>-H ALL</b>" to release all mail that is "on hold". As a 157 1.1.1.3 tron safety measure, the word <b>ALL</b> must be specified in upper case. 158 1.1 tron 159 1.1 tron This feature is available in Postfix 2.0 and later. 160 1.1 tron 161 1.1.1.5 christos <b>-p</b> Purge old temporary files that are left over after system or 162 1.1.1.5 christos software crashes. The <b>-p</b>, <b>-s</b>, and <b>-S</b> operations are done before 163 1.1.1.5 christos other operations. 164 1.1 tron 165 1.1 tron <b>-r</b> <i>queue</i><b>_</b><i>id</i> 166 1.1.1.3 tron Requeue the message with the named queue ID from the named mail 167 1.1.1.5 christos queue(s) (default: <b>hold</b>, <b>incoming</b>, <b>active</b> and <b>deferred</b>). 168 1.1.1.3 tron 169 1.1.1.5 christos To requeue multiple files, specify the <b>-r</b> option multiple times, 170 1.1.1.5 christos or specify a <i>queue</i><b>_</b><i>id</i> of <b>-</b> to read queue IDs from standard 171 1.1.1.5 christos input. 172 1.1.1.3 tron 173 1.1.1.5 christos Specify "<b>-r ALL</b>" to requeue all messages. As a safety measure, 174 1.1.1.3 tron the word <b>ALL</b> must be specified in upper case. 175 1.1.1.3 tron 176 1.1.1.3 tron A requeued message is moved to the <b>maildrop</b> queue, from where it 177 1.1.1.3 tron 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 178 1.1.1.5 christos file. In many respects its handling differs from that of a new 179 1.1 tron local submission. 180 1.1 tron 181 1.1.1.5 christos <b>o</b> The message is not subjected to the <a href="postconf.5.html#smtpd_milters">smtpd_milters</a> or 182 1.1.1.3 tron <a href="postconf.5.html#non_smtpd_milters">non_smtpd_milters</a> settings. When mail has passed through 183 1.1.1.5 christos an external content filter, this would produce incorrect 184 1.1.1.5 christos results with Milter applications that depend on original 185 1.1.1.3 tron SMTP connection state information. 186 1.1.1.3 tron 187 1.1.1.5 christos <b>o</b> The message is subjected again to mail address rewriting 188 1.1.1.3 tron and substitution. This is useful when rewriting rules or 189 1.1.1.3 tron virtual mappings have changed. 190 1.1.1.3 tron 191 1.1.1.5 christos The address rewriting context (local or remote) is the 192 1.1.1.3 tron same as when the message was received. 193 1.1.1.3 tron 194 1.1.1.5 christos <b>o</b> The message is subjected to the same <a href="postconf.5.html#content_filter">content_filter</a> set- 195 1.1.1.5 christos tings (if any) as used for new local mail submissions. 196 1.1.1.3 tron This is useful when <a href="postconf.5.html#content_filter">content_filter</a> settings have changed. 197 1.1.1.3 tron 198 1.1.1.5 christos Warning: Postfix queue IDs are reused (always with Postfix <= 199 1.1.1.5 christos 2.8; and with Postfix >= 2.9 when <a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a>=no). 200 1.1.1.3 tron There is a very small possibility that <a href="postsuper.1.html"><b>postsuper</b>(1)</a> requeues the 201 1.1.1.5 christos wrong message file when it is executed while the Postfix mail 202 1.1.1.3 tron system is running, but no harm should be done. 203 1.1 tron 204 1.1 tron This feature is available in Postfix 1.1 and later. 205 1.1 tron 206 1.1.1.5 christos <b>-s</b> Structure check and structure repair. This should be done once 207 1.1.1.5 christos before Postfix startup. The <b>-p</b>, <b>-s</b>, and <b>-S</b> operations are done 208 1.1.1.5 christos before other operations. 209 1.1 tron 210 1.1.1.3 tron <b>o</b> Rename files whose name does not match the message file 211 1.1.1.3 tron inode number. This operation is necessary after restoring 212 1.1.1.3 tron a mail queue from a different machine or from backup, 213 1.1.1.3 tron when queue files were created with Postfix <= 2.8 or with 214 1.1.1.3 tron "<a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a> = no". 215 1.1.1.3 tron 216 1.1.1.3 tron <b>o</b> Move queue files that are in the wrong place in the file 217 1.1.1.3 tron system hierarchy and remove subdirectories that are no 218 1.1.1.3 tron longer needed. File position rearrangements are neces- 219 1.1.1.3 tron sary after a change in the <b><a href="postconf.5.html#hash_queue_names">hash_queue_names</a></b> and/or 220 1.1 tron <b><a href="postconf.5.html#hash_queue_depth">hash_queue_depth</a></b> configuration parameters. 221 1.1 tron 222 1.1.1.3 tron <b>o</b> Rename queue files created with "<a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a> = 223 1.1.1.3 tron yes" to short names, for migration to Postfix <= 2.8. 224 1.1.1.3 tron The procedure is as follows: 225 1.1.1.2 tron 226 1.1.1.2 tron # postfix stop 227 1.1.1.2 tron # postconf <a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a>=no 228 1.1.1.2 tron # postsuper 229 1.1.1.2 tron 230 1.1.1.3 tron Run <a href="postsuper.1.html"><b>postsuper</b>(1)</a> repeatedly until it stops reporting file 231 1.1.1.3 tron name changes. 232 1.1.1.3 tron 233 1.1.1.3 tron <b>-S</b> A redundant version of <b>-s</b> that requires that long file names 234 1.1.1.3 tron also match the message file inode number. This option exists for 235 1.1.1.5 christos testing purposes, and is available with Postfix 2.9 and later. 236 1.1.1.5 christos The <b>-p</b>, <b>-s</b>, and <b>-S</b> operations are done before other operations. 237 1.1.1.2 tron 238 1.1.1.3 tron <b>-v</b> Enable verbose logging for debugging purposes. Multiple <b>-v</b> 239 1.1.1.3 tron options make the software increasingly verbose. 240 1.1 tron 241 1.1.1.8 christos <b><a name="diagnostics">DIAGNOSTICS</a></b> 242 1.1.1.5 christos Problems are reported to the standard error stream and to <b>syslogd</b>(8) or 243 1.1.1.5 christos <a href="postlogd.8.html"><b>postlogd</b>(8)</a>. 244 1.1 tron 245 1.1.1.3 tron <a href="postsuper.1.html"><b>postsuper</b>(1)</a> reports the number of messages deleted with <b>-d</b>, the number 246 1.1.1.5 christos of messages expired with <b>-e</b>, the number of messages expired or released 247 1.1.1.5 christos with <b>-f</b>, the number of messages held or released with <b>-h</b> or <b>-H</b>, the 248 1.1.1.5 christos number of messages requeued with <b>-r</b>, and the number of messages whose 249 1.1.1.5 christos queue file name was fixed with <b>-s</b>. The report is written to the stan- 250 1.1.1.5 christos dard error stream and to <b>syslogd</b>(8) or <a href="postlogd.8.html"><b>postlogd</b>(8)</a>. 251 1.1 tron 252 1.1.1.8 christos <b><a name="environment">ENVIRONMENT</a></b> 253 1.1 tron MAIL_CONFIG 254 1.1 tron Directory with the <a href="postconf.5.html"><b>main.cf</b></a> file. 255 1.1 tron 256 1.1.1.8 christos <b><a name="bugs">BUGS</a></b> 257 1.1.1.3 tron Mail that is not sanitized by Postfix (i.e. mail in the <b>maildrop</b> queue) 258 1.1.1.3 tron cannot be placed "on hold". 259 1.1 tron 260 1.1.1.8 christos <b><a name="configuration_parameters">CONFIGURATION PARAMETERS</a></b> 261 1.1.1.5 christos The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant to this pro- 262 1.1.1.5 christos gram. The text below provides only a parameter summary. See <a href="postconf.5.html"><b>post-</b></a> 263 1.1.1.3 tron <a href="postconf.5.html"><b>conf</b>(5)</a> for more details including examples. 264 1.1 tron 265 1.1 tron <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b> 266 1.1.1.5 christos The default location of the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> con- 267 1.1.1.3 tron figuration files. 268 1.1 tron 269 1.1 tron <b><a href="postconf.5.html#hash_queue_depth">hash_queue_depth</a> (1)</b> 270 1.1.1.5 christos The number of subdirectory levels for queue directories listed 271 1.1.1.3 tron with the <a href="postconf.5.html#hash_queue_names">hash_queue_names</a> parameter. 272 1.1 tron 273 1.1 tron <b><a href="postconf.5.html#hash_queue_names">hash_queue_names</a> (deferred, defer)</b> 274 1.1.1.5 christos The names of queue directories that are split across multiple 275 1.1.1.3 tron subdirectory levels. 276 1.1 tron 277 1.1.1.5 christos <b><a href="postconf.5.html#import_environment">import_environment</a> (see 'postconf -d' output)</b> 278 1.1.1.8 christos The list of environment variables that a privileged Postfix 279 1.1.1.5 christos process will import from a non-Postfix parent process, or 280 1.1.1.5 christos name=value environment overrides. 281 1.1.1.5 christos 282 1.1 tron <b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b> 283 1.1.1.3 tron The location of the Postfix top-level queue directory. 284 1.1 tron 285 1.1 tron <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b> 286 1.1 tron The syslog facility of Postfix logging. 287 1.1 tron 288 1.1 tron <b><a href="postconf.5.html#syslog_name">syslog_name</a> (see 'postconf -d' output)</b> 289 1.1.1.5 christos A prefix that is prepended to the process name in syslog 290 1.1.1.5 christos records, so that, for example, "smtpd" becomes "prefix/smtpd". 291 1.1 tron 292 1.1.1.2 tron Available in Postfix version 2.9 and later: 293 1.1.1.2 tron 294 1.1.1.2 tron <b><a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a> (no)</b> 295 1.1.1.3 tron Enable long, non-repeating, queue IDs (queue file names). 296 1.1.1.2 tron 297 1.1.1.8 christos <b><a name="see_also">SEE ALSO</a></b> 298 1.1 tron <a href="sendmail.1.html">sendmail(1)</a>, Sendmail-compatible user interface 299 1.1 tron <a href="postqueue.1.html">postqueue(1)</a>, unprivileged queue operations 300 1.1.1.5 christos <a href="postlogd.8.html">postlogd(8)</a>, Postfix logging 301 1.1.1.5 christos syslogd(8), system logging 302 1.1 tron 303 1.1.1.8 christos <b><a name="license">LICENSE</a></b> 304 1.1.1.3 tron The Secure Mailer license must be distributed with this software. 305 1.1 tron 306 1.1 tron <b>AUTHOR(S)</b> 307 1.1 tron Wietse Venema 308 1.1 tron IBM T.J. Watson Research 309 1.1 tron P.O. Box 704 310 1.1 tron Yorktown Heights, NY 10598, USA 311 1.1 tron 312 1.1.1.4 christos Wietse Venema 313 1.1.1.4 christos Google, Inc. 314 1.1.1.4 christos 111 8th Avenue 315 1.1.1.4 christos New York, NY 10011, USA 316 1.1.1.4 christos 317 1.1 tron POSTSUPER(1) 318 1.1 tron </pre> </body> </html> 319