Mail queue triage: Exim and Postfix
Understand queue evidence and distinguish a delay from a permanent rejection.
By the end of this lesson
- Recognise the installed MTA before choosing its tools
- Distinguish temporary and permanent SMTP outcomes
- Collect a useful queue incident summary without forcing delivery
Your environment: The lab is offline. Live queue checks are only for an authorised host running the matching MTA. Setup help
A queue is evidence of unfinished work
Mail submission, queueing, routing and remote delivery are separate stages. A message can be accepted locally while remote delivery is still pending. A growing queue might reflect DNS failure, a remote temporary rejection, routing problems or local resource pressure. The count alone is not a diagnosis.
Identify whether the host runs Exim, Postfix or another MTA before choosing commands. On Exim, exim -bp lists the queue. Postfix provides postqueue -p; mailq may be installed as a compatibility command. Access to detailed logs or message data can be restricted. Do not assume an empty display and a permission failure mean the same thing.
Read codes in their context
SMTP 4xx responses normally indicate temporary failure, while 5xx responses normally indicate permanent failure for that attempt or command. Read the full text and stage, not just the first digit. A remote 451 and a local inability to resolve an MX need different investigations. Message age, repeated recipients and recent configuration changes can provide the missing context.
Begin with read-only queue and log inspection on an authorised lab. Do not flush, delete or force-deliver a whole queue to see what happens. Preserve message IDs for correlation, avoid exposing message bodies, and record a bounded sample with timestamps and redacted addresses when handing an incident to someone else.
See it in context
Worked example
Choose the installed MTA; these examples are not setup instructions.
# Exim queue inspection:
# exim -bp
# Postfix queue inspection:
# postqueue -pUncomment only the matching command on an authorised mail host. This course uses a fictional evidence file so you do not need to install an MTA or send mail.
Your turn
Practical lab
Explain a delayed-mail incident from a small, fictional evidence set.
Run commands in your own lab. This website displays instructions; the practice terminal below helps you rehearse the syntax.
1. Prepare your workspace
mkdir -p "$HOME/training4linux/mail"
cd "$HOME/training4linux/mail"
printf "%s\n" "MTA: Exim" "Queue age: 42 minutes" "Attempt: remote MX answered 451 temporary local problem" "DNS MX lookup: NOERROR with expected exchanger" > mail-evidence.txt2. Complete the task
- Classify the remote response as temporary or permanent.
- Explain what the DNS result supports and what it does not prove.
- Write a handover including symptom, age, remote response, next check and a reason not to flush the queue blindly.
3. Check your result
- The response is treated as a temporary remote failure.
- You do not declare successful final delivery merely because MX lookup worked.
- Your handover suggests inspecting retry history and remote status rather than deleting messages.
Need a hint?
The remote server answered at the SMTP stage, so distinguish that evidence from a failure to resolve its name.
Reveal a worked solution
Compare this with your approach after trying the task. More than one valid solution may exist.
cat mail-evidence.txt
printf "%s\n" "Mail is delayed; oldest observed item is 42 minutes." "Evidence: remote MX returned 451; MX lookup succeeded." "Next: inspect bounded retry history and contact the remote operator if persistent." "Do not delete or force the whole queue without an approved plan." > handover.txtAfter the lab: No mail was sent and no queue was modified.
Common mistakes to avoid
- Do not use queue deletion or force-delivery commands as diagnostic shortcuts.
Check your understanding
Knowledge check
Answer all 3 questions correctly to pass. Retry as often as you need; your best score is kept.
Your lesson progress
Not started · Best score: 0% · Attempts: 0
Practical completion is self-reported. Progress is linked to a private cookie in this browser and stored on the site. Clearing that cookie loses access to it. Manage or erase progress.