POSTSUPER(1)
๐ postsuper(1) ๐
okay bestie, welcome to the General Commands Manual page for postsuper(1) โ the Postfix superintendent ๐. this is the command that keeps your mail queue cute and organized, and she is iconic, no cap.
๐ธ NAME ๐ธ
postsuper โ Postfix superintendent ๐ง
โจ SYNOPSIS โจ
postsuper [-psSv]
[-c config_dir] [-d queue_id]
[-e queue_id] [-f queue_id]
[-h queue_id] [-H queue_id]
[-r queue_id] [directory ...]
๐ DESCRIPTION ๐
okay so the tea is: postsuper(1) does maintenance jobs on the Postfix queue. that's the whole vibe. but โ and this is the important part โ only the superuser can run it. it's giving VIP-only, fr fr. if you want the unprivileged queue operations (like listing the queue or flushing it), go look at the postqueue(1) command instead, bestie, that one's for the girlies without root ๐ซถ
by default, postsuper(1) performs the operations you asked for with the -s and -p command-line options on all Postfix queue directories. and when I say all, I mean all:
- the
incoming,active,deferred, andholddirectories, which hold the message files - the
bounce,defer,traceandflushdirectories, which hold the log files
๐ OPTIONS ๐
-c config_dirโ themain.cfconfiguration file lives in the named directory instead of the default configuration directory. also peep theMAIL_CONFIGenvironment setting further down ๐-d queue_idโ delete one message with the named queue ID from the named mail queue(s) (default:hold,incoming,activeanddeferred). yeet it. bye bye ๐- wanna delete multiple files? specify the
-doption multiple times, or hand over aqueue_idof-and she'll read queue IDs from standard input. for example, to delete all mail with exactly one recipientuser@example.com:
- wanna delete multiple files? specify the
postqueue -j | jq -r '
# See JSON OBJECT FORMAT section in the postqueue(1) manpage
select(.recipients[0].address == "user@example.com")
| select(.recipients[1].address == null)
| .queue_id
' | postsuper -d -
(note the jq -r option, bestie, it matters). or, if you're feeling historical, the old-school form:
mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "user@example.com" && $9 == "")
print $1 }
' | tr -d '*!' | postsuper -d -
- specify
-d ALLto remove all messages; for example, specify-d ALL deferredto delete all mail in thedeferredqueue. and as a safety measure, the wordALLmust be specified in upper case. lowercaseallwill not slay. it will not work.
Warning: Postfix queue IDs are reused (always with Postfix <= 2.8; and with Postfix >= 2.9 whenenable_long_queue_ids=no). There is a very small possibility thatpostsuperdeletes the wrong message file when it is executed while the Postfix mail system is delivering mail.
the scenario is as follows:
- The Postfix queue manager deletes the message that
postsuper(1)is asked to delete, because Postfix is finished with the message (it is delivered, or it is returned to the sender). - New mail arrives, and the new message is given the same queue ID as the message that
postsuper(1)is supposed to delete. The probability for reusing a deleted queue ID is about1 in 2**15(the number of different microsecond values that the system clock can distinguish within a second). postsuper(1)deletes the new message, instead of the old message that it should have deleted. ๐ญ
-e queue_idโ ok so this one's whole description lives down in the-fentry (scroll down, bestie, they're twins ๐ฏ)-f queue_idโ request forced expiration for one message with the named queue ID in the named mail queue(s) (default:hold,incoming,activeanddeferred).- The message will be returned to the sender when the queue manager attempts to deliver that message (note that Postfix will never deliver messages in the
holdqueue). - The
-eand-foptions both request forced expiration. The difference is that-fwill also release a message if it is in theholdqueue. With-e, such a message would not be returned to the sender until it is released with-for-H. - When a deferred message is force-expired, the return message will state the reason for the delay. Otherwise, the reason will be
"message is administratively expired".
- The message will be returned to the sender when the queue manager attempts to deliver that message (note that Postfix will never deliver messages in the
to expire multiple files, specify the -e or -f option multiple times, or specify a queue_id of - to read queue IDs from standard input (see the -d option above for an example, but be sure to replace -d in the example, bestie ๐ซถ).
specify -e ALL or -f ALL to expire all messages; for example, specify -e ALL deferred to expire all mail in the deferred queue. as a safety measure, the word ALL must be specified in upper case.
these features are available in Postfix 3.5 and later.
-h queue_idโ put mail "on hold" so that no attempt is made to deliver it. move one message with the named queue ID from the named mail queue(s) (default:incoming,activeanddeferred) to theholdqueue. it's giving "girl sit down and wait" ๐- to hold multiple files, specify the
-hoption multiple times, or specify aqueue_idof-to read queue IDs from standard input. - specify
-h ALLto hold all messages; for example, specify-h ALL deferredto hold all mail in thedeferredqueue. as a safety measure, the wordALLmust be specified in upper case.
- to hold multiple files, specify the
Note: while mail is "on hold" it will not expire when its time in the queue exceeds themaximal_queue_lifetimeorbounce_queue_lifetimesetting. It becomes subject to expiration after it is released from "hold".
this feature is available in Postfix 2.0 and later.
-H queue_idโ release mail that was put "on hold". move one message with the named queue ID from the named mail queue(s) (default:hold) to thedeferredqueue. she's free!! ๐ฆ- to release multiple files, specify the
-Hoption multiple times, or specify aqueue_idof-to read queue IDs from standard input.
- to release multiple files, specify the
Note: specifypostsuper -rto release mail that was kept on hold for a significant fraction of$maximal_queue_lifetimeor$bounce_queue_lifetime, or longer.
specify -H ALL to release all mail that is "on hold". as a safety measure, the word ALL must be specified in upper case.
this feature is available in Postfix 2.0 and later.
-pโ purge old temporary files that are left over after system or software crashes. spring cleaning ๐งนโจ The-p,-s, and-Soperations are done before other operations.-r queue_idโ requeue the message with the named queue ID from the named mail queue(s) (default:hold,incoming,activeanddeferred).- to requeue multiple files, specify the
-roption multiple times, or specify aqueue_idof-to read queue IDs from standard input. - specify
-r ALLto requeue all messages. as a safety measure, the wordALLmust be specified in upper case.
- to requeue multiple files, specify the
a requeued message is moved to the maildrop queue, from where it is copied by the pickup(8) and cleanup(8) daemons to a new queue file. In many respects its handling differs from that of a new local submission. ๐
- The message is not subjected to the
smtpd_miltersornon_smtpd_milterssettings. When mail has passed through an external content filter, this would produce incorrect results with Milter applications that depend on original SMTP connection state information. - The message is subjected again to mail address rewriting and substitution. This is useful when rewriting rules or virtual mappings have changed. The address rewriting context (local or remote) is the same as when the message was received.
- The message is subjected to the same
content_filtersettings (if any) as used for new local mail submissions. This is useful whencontent_filtersettings have changed.
Warning: Postfix queue IDs are reused (always with Postfix <= 2.8; and with Postfix >= 2.9 whenenable_long_queue_ids=no). There is a very small possibility thatpostsuper(1)requeues the wrong message file when it is executed while the Postfix mail system is running, but no harm should be done. phew ๐ฎโ๐จ
this feature is available in Postfix 1.1 and later.
-sโ structure check and structure repair. this should be done once before Postfix startup. The-p,-s, and-Soperations are done before other operations.- Rename files whose name does not match the message file inode number. This operation is necessary after restoring a mail queue from a different machine or from backup, when queue files were created with Postfix <= 2.8 or with
"enable_long_queue_ids = no". - Move queue files that are in the wrong place in the file system hierarchy and remove subdirectories that are no longer needed. File position rearrangements are necessary after a change in the
hash_queue_namesand/orhash_queue_depthconfiguration parameters. - Rename queue files created with
"enable_long_queue_ids = yes"to short names, for migration to Postfix <= 2.8. The procedure is as follows:
- Rename files whose name does not match the message file inode number. This operation is necessary after restoring a mail queue from a different machine or from backup, when queue files were created with Postfix <= 2.8 or with
# postfix stop
# postconf enable_long_queue_ids=no
# postsuper
Run postsuper(1) repeatedly until it stops reporting file name changes. like, keep going bestie, she'll tell you when she's done ๐
-Sโ a redundant version of-sthat requires that long file names also match the message file inode number. This option exists for testing purposes, and is available with Postfix 2.9 and later. The-p,-s, and-Soperations are done before other operations.-vโ enable verbose logging for debugging purposes. Multiple-voptions make the software increasingly verbose. one-vis a little chatty, five-vis her telling you her whole life story ๐ฃ๏ธโจ
๐ฉบ DIAGNOSTICS ๐ฉบ
Problems are reported to the standard error stream and to syslogd(8) or postlogd(8).
postsuper(1) reports:
- the number of messages deleted with
-d - the number of messages expired with
-e - the number of messages expired or released with
-f - the number of messages held or released with
-hor-H - the number of messages requeued with
-r - the number of messages whose queue file name was fixed with
-s
The report is written to the standard error stream and to syslogd(8) or postlogd(8). receipts, basically ๐งพโจ
๐ ENVIRONMENT ๐
MAIL_CONFIGโ Directory with themain.cffile.
๐ BUGS (bestie we keep it real here) ๐
Mail that is not sanitized by Postfix (i.e. mail in the maildrop queue) cannot be placed "on hold".
Not me finding this out the hard way ๐ญ the maildrop stuff is off-limits for holding, fr fr.
โ๏ธ CONFIGURATION PARAMETERS โ๏ธ
The following main.cf parameters are especially relevant to this program. The text below provides only a parameter summary. See postconf(5) for more details including examples.
config_directory(seepostconf -doutput) โ The default location of the Postfixmain.cfandmaster.cfconfiguration files. ๐hash_queue_depth(1) โ The number of subdirectory levels for queue directories listed with thehash_queue_namesparameter.hash_queue_names(deferred, defer) โ The names of queue directories that are split across multiple subdirectory levels.import_environment(seepostconf -doutput) โ The list of environment variables that a privileged Postfix process will import from a non-Postfix parent process, orname=valueenvironment overrides.queue_directory(seepostconf -doutput) โ The location of the Postfix top-level queue directory.syslog_facility(mail) โ The syslog facility of Postfix logging.syslog_name(seepostconf -doutput) โ A prefix that is prepended to the process name in syslog records, so that, for example,smtpdbecomesprefix/smtpd.
๐ Available in Postfix version 2.9 and later: ๐
enable_long_queue_ids(no) โ Enable long, non-repeating, queue IDs (queue file names). obsessed with this one honestly
๐ SEE ALSO ๐
sendmail(1), Sendmail-compatible user interfacepostqueue(1), unprivileged queue operationspostlogd(8), Postfix loggingsyslogd(8), system logging
๐ LICENSE ๐
The Secure Mailer license must be distributed with this software.
๐ AUTHOR(S) ๐
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA
Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA
okay that's the whole page bestie, we made it ๐ซถ๐ this is POSTSUPER(1), and the footer says POSTSUPER(1) โ slay, iconic, periodt โจ๐
๐ฆ where this page comes from
- alpine 3.22: postfix-doc 3.10.13-r0 ยท IPL-1.0 EPL-2.0
- alpine 3.23: postfix-doc 3.10.13-r0 ยท IPL-1.0 EPL-2.0
- alpine 3.24: postfix-doc 3.11.7-r0 ยท IPL-1.0 EPL-2.0
- arch rolling: postfix 3.11.7-1 ยท EPL-2.0 OR IPL-1.0 AND BSD-4-Clause-UC
- debian trixie: postfix 3.10.13-0+deb13u1
- fedora 43: postfix 2:3.10.14-1.fc43 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 43: postfix 2:3.10.3-3.fc43 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.14-1.fc44 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.7-2.fc44 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- ubuntu questing: postfix 3.10.2-1ubuntu2
- ubuntu questing: postfix 3.10.2-1ubuntu2.1
- ubuntu resolute: postfix 3.10.6-4ubuntu2
- ubuntu resolute: postfix 3.10.6-4ubuntu2.1
- ubuntu resolute: postfix 3.10.6-4ubuntu2.2
- ubuntu stonking: postfix 3.11.7-1ubuntu2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms