postqueue

Manage the Postfix mail queue

TLDR

List mail queue
$ postqueue -p
Flush mail queue
$ postqueue -f
Flush specific site
$ postqueue -s [example.com]
Schedule immediate delivery of a specific message
$ postqueue -i [queue_id]
List in JSON format
$ postqueue -j

SYNOPSIS

postqueue [options]

DESCRIPTION

postqueue manages the Postfix mail queue, providing safe access to queue operations for regular users without requiring root privileges. It displays queued messages with their IDs, sizes, arrival times, senders, and recipients, and can trigger delivery retry attempts.The flush option forces immediate delivery attempts for all deferred mail or for a specific destination site. JSON output mode makes queue data easily parseable for monitoring scripts. For advanced queue management like deleting or holding individual messages, the privileged postsuper command is needed instead.

PARAMETERS

-p

Print queue contents.
-f
Flush queue (retry delivery).
-s site
Flush specific site.
-i queueid_
Schedule immediate delivery of deferred mail with the specified queue ID.
-j
Produce queue listing in JSON format.
-v
Enable verbose logging for debugging. Multiple -v options increase verbosity.
-c dir
Use the specified configuration directory instead of the default.

EXAMPLES

$ # View queue
postqueue -p

# Flush all queued mail
postqueue -f

# Retry specific domain
postqueue -s gmail.com

# JSON output for scripting
postqueue -j

# Retry delivery of a specific message
postqueue -i ABC123DEF

# Count queued messages
postqueue -p | tail -1

QUEUE OUTPUT

$ -Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
ABC123DEF     1234 Mon Jan 01 12:00:00  [email protected]
                                         [email protected]

QUEUE LOCATIONS

$ /var/spool/postfix/incoming  - New mail
/var/spool/postfix/active    - Being delivered
/var/spool/postfix/deferred  - Temporary failures
/var/spool/postfix/hold      - Manually held

INSTALL

sudo apt install postfix
sudo dnf install postfix
sudo pacman -S postfix
sudo apk add postfix
sudo zypper install postfix
nix profile install nixpkgs#postfix

CAVEATS

Flushing may not help permanent failures. Use postsuper for advanced queue management.

HISTORY

postqueue is part of Postfix by Wietse Venema, providing safe queue management for unprivileged users.

SEE ALSO

mailq(1), postfix(1), postconf(1), postmap(1), sendmail(1)