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 β€” the main.cf config 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 traditional sendmail -q command by contacting the Postfix qmgr(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 traditional sendmail -qI command, by contacting the flush(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 the showq(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 traditional mailq command, by contacting the Postfix showq(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 the postsuper(1) options -e or -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. see flush(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 -v options 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. the queue_id may be reused within a Postfix instance unless "enable_long_queue_ids = true" and time is monotonic. even then, the queue_id is not expected to be unique between different Postfix instances. management tools that require a unique name should combine the queue_id with the myhostname setting 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 (true or false). see the postsuper(1) options -e or -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 the main.cf file. 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.cf file with the alternate_config_directories or multi_instance_directories configuration parameter.
    • the command is invoked by the super-user.

βš™οΈ 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 of sendmail(1), with the "-C" option), or via the MAIL_CONFIG environment parameter.
  • config_directory (see 'postconf -d' output) β€” the default location of the Postfix main.cf and master.cf configuration 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, or name=value environment 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, the pickup(8) or qmgr(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 πŸ‘€


πŸ“š 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