Hands-on Lab·LPIC-2
A message in the queue and why it is still there
Accepting a message is not delivering it. This guide sends one message that fails permanently and one that fails temporarily, shows that only the second is queued, finds the queued file on disk, reads it with postcat, asks how long Postfix will keep trying, and deletes it - then proves local delivery never went near the relay at all.
202: E-Mail Services Guide 29 of 29 Intermediate
- OSUbuntu 26.04 LTS
- Kernel7.0.0-30-generic
- systemd259
- Block devicesone 50 GB disk
- TimeAbout 26 min
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC2-A01 | 192.168.0.78 | Ubuntu 26.04 LTS | Primary service host - BIND, Apache, Samba, Postfix. Topic 204 RAID runs on loop devices; this machine has no spare disk | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when mail has been sent and has not arrived, and you need to say whether it is still coming. This matters because sendmail exits 0 for a message that will never be delivered, and because the queue holds the reason for every message in it.
- reading a DSN code's first digit as permanent against temporary
- knowing that a bounced message is not in the queue and never will be
- listing the queue with
postqueue -pand reading the reason attached to each message - finding the queue file on disk and reading it with
postcat -q - stating how long a message will be retried, from
postconf - flushing and deleting queued mail with
postqueue -fandpostsuper -d
Before you start
- an-mta-that-accepts-and-one-that-refuses
-
An MTA, and an empty queue
-
A permanent failure never reaches the queue
-
A relay that will never answer
-
Where that message physically is
-
How long it will keep trying
-
Local delivery, which the relay never sees
-
Emptying the queue on purpose
-
Putting the machine back