Postfix Deferred Mail Queue: Clearing a Relay Backlog

Updated 2026-11-01

Transactional email silently stops going out and the mail queue keeps growing. In Postfix that almost always means deliveries are deferring — the server accepted the mail but can't hand it to the next hop, so it keeps retrying on a backoff while the queue piles up.

Read the queue and the log

mailq | tail            # or: postqueue -p   (how deep, and to where)
tail -f /var/log/mail.log
# status=deferred (connect to relay timed out) = relay is the problem

The status= text is the whole story: deferred with a connection timeout points at the relayhost; bounced with a 5xx points at auth or recipient problems.

Fix the relay, then flush

# /etc/postfix/main.cf
relayhost = [smtp.relay.internal]:587

postfix reload          # pick up the config
postqueue -f            # flush: retry every deferred message now

Don't just postqueue -f on repeat — flushing before you fix the relay only hammers a dead host and resets the backoff. Fix the cause first, then flush once.

Practise it

A deferred mail backlog is one of the simulator's mail-tier incidents. Work it in a full incident response shift.

Learn it by doing

Create a free account and practise on a live fleet.

← All guides