LinuxCommandLibrary

postqueue

Manage the Postfix mail queue

TLDR

List mail queue

$ postqueue -p
copy
Flush mail queue
$ postqueue -f
copy
Flush specific site
$ postqueue -s [example.com]
copy
List in JSON format
$ postqueue -j
copy

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.
-j
JSON output format.
-c dir
Configuration directory.

EXAMPLES

$ # View queue
postqueue -p

# Flush all queued mail
postqueue -f

# Retry specific domain
postqueue -s gmail.com

# JSON output for scripting
postqueue -j

# Count queued messages
postqueue -p | tail -1
copy

QUEUE OUTPUT

$ -Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
ABC123DEF     1234 Mon Jan 01 12:00:00  sender@example.com
                                         recipient@dest.com
copy

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
copy

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

postsuper(1), mailq(1), postfix(1), sendmail(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community