postqueue
Manage Postfix mail queue
SYNOPSIS
postqueue [options]
PARAMETERS
-c config_dir
Specify an alternative Postfix configuration directory instead of the default.
-f
Force an immediate attempt to deliver all messages currently in the mail queue. This triggers a queue scan and delivery process.
-i queue_id
Force a delivery attempt for a specific message identified by its queue ID. This is useful for prioritizing a single message.
-j
Output the queue information in JSON format, which is useful for programmatic parsing and integration with other systems.
-p
Print the contents of the mail queue. This is the default action if no other command-line option is specified. It shows details like queue ID, size, sender, and recipients.
-q
Force a scan and delivery attempt for the entire mail queue. This option is similar to -f but can be combined with other options like -i, -s, or -u to target specific deliveries.
-s site
Force delivery attempts for messages destined for a specific remote site or domain.
-u sender
Force delivery attempts for messages originating from a specific sender email address.
-v
Enable verbose logging to standard error, providing more detailed information about the command's execution and progress.
DESCRIPTION
postqueue is a powerful command-line utility within the Postfix mail system, designed for administrators to examine and manipulate the mail queue. It allows users to view messages currently awaiting delivery, force an immediate attempt to flush the queue, or target specific messages or destinations for accelerated delivery. This command is indispensable for diagnosing mail delivery issues, monitoring server load related to email, and ensuring the smooth flow of outgoing mail. It provides a real-time snapshot of the Postfix mail queue's status, detailing deferred, active, and incoming messages.
CAVEATS
postqueue requires root privileges or appropriate Postfix permissions to execute most operations.
While postqueue -f can trigger delivery attempts, it does not guarantee immediate delivery, as other factors like network issues or recipient server availability can still cause delays.
Removing messages from the queue is typically handled by the postsuper -d command, not postqueue.
COMMON USE CASES
To check for stuck mail: postqueue -p
To force delivery of all waiting mail: postqueue -f
To force delivery of a specific message (e.g., ID A1B2C3D4): postqueue -i A1B2C3D4
To see verbose output during a queue run: postqueue -f -v
INTERPRETING <I>POSTQUEUE -P</I> OUTPUT
The output of postqueue -p lists messages in the queue with their queue ID, size, arrival time, sender, and recipient(s).
Messages marked with (deferred) indicate a temporary delivery failure, meaning Postfix will retry delivery later. The reason for deferral is often shown in the next line. Other statuses like active mean the message is currently being processed for delivery.
HISTORY
postqueue is an integral part of the Postfix mail transfer agent (MTA), a robust and secure mail server developed by Wietse Venema starting in 1998. Postfix was designed as a modern, high-performance, and secure alternative to older MTAs like Sendmail. The postqueue utility was developed as part of this ecosystem to provide fine-grained control and visibility into the mail queue, evolving alongside Postfix's architecture to support its various queue types and delivery mechanisms.