Docs / Email Servers / Postfix Mail Queue Management Commands

Postfix Mail Queue Management Commands

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 219 views · 1 min read

Viewing the Mail Queue

Postfix maintains a queue of messages waiting to be delivered. Understanding queue management helps troubleshoot delivery issues.

# Show queued messages
postqueue -p

# Count messages in queue
postqueue -p | tail -n 1

# Detailed queue summary
qshape deferred

Queue Directories

DirectoryPurpose
incomingNewly received messages
activeCurrently being delivered
deferredTemporarily failed, will retry
holdManually held messages
corruptDamaged queue files

Flushing the Queue

# Retry all deferred messages immediately
postqueue -f

# Retry a specific message
postqueue -i QUEUE_ID

# Flush messages for a specific domain
postqueue -s example.com

Deleting Messages

# Delete a specific message
postsuper -d QUEUE_ID

# Delete ALL queued messages (use with caution)
postsuper -d ALL

# Delete only deferred messages
postsuper -d ALL deferred

Holding and Releasing

# Put a message on hold
postsuper -h QUEUE_ID

# Release a held message
postsuper -H QUEUE_ID

# Hold all messages
postsuper -h ALL

Inspecting a Message

# View message headers and envelope
postcat -q QUEUE_ID

# View full message content
postcat -bh QUEUE_ID

Common Troubleshooting

If the deferred queue grows large, check /var/log/mail.log for recurring errors. Common causes include DNS resolution failures, remote server rejections, and network connectivity issues.

Was this article helpful?