POSTQUEUE(1)
β¨ POSTQUEUE(1) β¨
okay bestie, so this is postqueue from the General Commands Manual, section 1 β the little icon that runs your whole mail queue situation π
π NAME π
postqueue β Postfix queue control. that's it. that's the job. she manages the queue and she's obsessed with it π
πΈ SYNOPSIS πΈ
so like, there are two moods here and you gotta pick one, no cap.
to flush the mail queue:
postqueue [-v] [-c config_dir] -f
postqueue [-v] [-c config_dir] -i queue_id
postqueue [-v] [-c config_dir] -s site
to list the mail queue:
postqueue [-v] [-c config_dir] -j
postqueue [-v] [-c config_dir] -p
π¦ DESCRIPTION π¦
so the postqueue(1) command is literally the Postfix user interface for queue management π«Ά she does all the operations that, historically, you'd get from the sendmail(1) command. if you need the serious stuff β like deleting a message out of the queue or changing a message's status β that needs super-user privileges and you want postsuper(1) for that, not her. she's the fun one, not the bouncer π
here's every option she recognizes, and yes we're doing all of them:
-c config_dirβ themain.cfconfig file lives in the named directory instead of the default configuration directory. also peep the MAIL_CONFIG environment setting below π-fβ flush the queue: try to deliver all the queued mail. this one implements the traditionalsendmail -qcommand by contacting the Postfixqmgr(8)daemon.
β οΈ warning bestie, listen: flushing undeliverable mail frequently will result in poor delivery performance of all your other mail. like, don't spam the flush button. she will get tired. π
-i queue_idβ schedule immediate delivery of deferred mail with the specified queue ID. this implements the traditionalsendmail -qIcommand, by contacting theflush(8)server.
this feature is available with Postfix version 2.4 and later.
-jβ produce a queue listing in JSON LINES format, based on output from theshowq(8)daemon. check out "JSON OBJECT FORMAT" below for the deets β¨
this feature is available in Postfix 3.1 and later.
-pβ produce a traditional sendmail-style queue listing. this option implements the traditionalmailqcommand, by contacting the Postfixshowq(8)daemon.
every queue entry shows the queue file ID, message size, arrival time, sender, and the recipients that still need to be delivered. if mail couldn't be delivered on the last attempt, the reason for failure is shown. with Postfix >= 3.11, the output may also show bounced recipients that are pending the creation of a non-delivery status notification message that will be returned to the sender.
the queue ID string is followed by an optional status character, and these are iconic:
*β the message is in the active queue, i.e. the message is selected for delivery. main character energy π!β the message is in the hold queue, i.e. no further delivery attempt will be made until the mail is taken off hold. she's on pause π§#β the message is forced to expire. see thepostsuper(1)options-eor-f.
this feature is available in Postfix 3.5 and later.
-s siteβ schedule immediate delivery of all mail that is queued for the named site. a numerical site must be specified as a valid RFC 5321 address literal enclosed in[], just like in email addresses. the site must be eligible for the "fast flush" service. seeflush(8)for more info about that "fast flush" service π«
this option implements the traditional sendmail -qRsite command, by contacting the Postfix flush(8) daemon.
-vβ enable verbose logging for debugging purposes. multiple-voptions make the software increasingly verbose. as of Postfix 2.3, this option is available for the super-user only. so if you're not root, no verbose for you π
π JSON OBJECT FORMAT π
each JSON object represents one queue file; it's emitted as a single text line followed by a newline character.
object members have string values unless indicated otherwise. programs should ignore object members that aren't listed here β the list of members is expected to grow over time, she's evolving fr fr π±
queue_nameβ the name of the queue where the message was found. note that the contents of the mail queue may change while it's being listed; some messages may appear more than once, and some messages may be missed. it's giving chaos but it's fine πqueue_idβ the queue file name. thequeue_idmay be reused within a Postfix instance unless"enable_long_queue_ids = true"and time is monotonic. even then, thequeue_idis not expected to be unique between different Postfix instances. management tools that require a unique name should combine thequeue_idwith themyhostnamesetting of the Postfix instance.arrival_timeβ the number of seconds since the start of the UNIX epoch. β°message_sizeβ the number of bytes in the message header and body. this number does not include message envelope information. it's approximately equal to the number of bytes that would be transmitted via SMTP including the<CR><LF>line endings.forced_expire(Postfix >= 3.5) β the message is forced to expire (trueorfalse). see thepostsuper(1)options-eor-f.senderβ the envelope sender address.recipientsβ an array containing zero or more objects with members:addressβ one recipient address.orig_address(Postfix >= 3.11) β one original recipient address.delay_reasonβ if present, the reason for delayed delivery. delayed recipients may have no delay reason, for example, while delivery is in progress, or after the system was stopped before it could record the reason.bounce_reason(Postfix >= 3.11) β if present, the reason why this recipient was bounced. the recipient is still pending the creation of a non-delivery status notification message that will be returned to the sender.
π SECURITY π
this program is designed to run with set-group ID privileges, so that it can connect to Postfix daemon processes. that's her whole thing π
π STANDARDS π
RFC 7159 (JSON notation) β she speaks fluent JSON, no cap.
π©Ί DIAGNOSTICS π©Ί
problems are logged to syslogd(8) or postlogd(8), and to the standard error stream. so if something's wrong, she's telling you in two places, very loudly π
π ENVIRONMENT π
MAIL_CONFIGβ directory with themain.cffile. in order to avoid exploitation of set-group ID privileges, a non-default directory is allowed only if:- the name is listed in the default
main.cffile with thealternate_config_directoriesormulti_instance_directoriesconfiguration parameter. - the command is invoked by the super-user.
- the name is listed in the default
βοΈ CONFIGURATION PARAMETERS βοΈ
these are the main.cf parameters that are especially relevant to this program. the text below provides only a parameter summary β see postconf(5) for way more details including examples, bestie π
alternate_config_directories(empty) β a list of non-default Postfix configuration directories that may be specified with"-c config_directory"on the command line (in the case ofsendmail(1), with the"-C"option), or via theMAIL_CONFIGenvironment parameter.config_directory(see'postconf -d'output) β the default location of the Postfixmain.cfandmaster.cfconfiguration files.command_directory(see'postconf -d'output) β the location of all postfix administrative commands.fast_flush_domains($relay_domains) β optional list of destinations that are eligible for per-destination logfiles with mail that is queued to those destinations.import_environment(see'postconf -d'output) β the list of environment variables that a privileged Postfix process will import from a non-Postfix parent process, orname=valueenvironment overrides.queue_directory(see'postconf -d'output) β the location of the Postfix top-level queue directory.syslog_facility(mail) β the syslog facility of Postfix logging.syslog_name(see'postconf -d'output) β a prefix that is prepended to the process name in syslog records, so that, for example,"smtpd"becomes"prefix/smtpd".trigger_timeout(10s) β the time limit for sending a trigger to a Postfix daemon (for example, thepickup(8)orqmgr(8)daemon).
available in Postfix version 2.2 and later:
authorized_flush_users(static:anyone) β list of users who are authorized to flush the queue.authorized_mailq_users(static:anyone) β list of users who are authorized to view the queue.
π FILES π
/var/spool/postfix, mail queue β yeah, that's where she keeps everything π
π SEE ALSO π
qmgr(8), queue managershowq(8), list mail queueflush(8), fast flush servicesendmail(1), Sendmail-compatible user interfacepostsuper(1), privileged queue operationspostlogd(8), Postfix loggingsyslogd(8), system logging
π README FILES π
use "postconf readme_directory" or "postconf html_directory" to locate this information. she's not gonna hand it to you, but she'll tell you exactly where to look π«Ά
ETRN_README, Postfix ETRN howto
π LICENSE π
The Secure Mailer license must be distributed with this software. read it, it's important β¨
π°οΈ HISTORY π°οΈ
the postqueue command was introduced with Postfix version 1.1. she's been iconic since day one, periodt π
π 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
and that's the whole thing bestie π she's from the General Commands Manual (the POSTQUEUE(1) page, section 1, iykyk) β go flush responsibly, drink water, and don't spam -f πβ¨π¦
π¦ where this page comes from
- 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
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- 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