Mail problems on cPanel almost always live in Exim. Tracing a single message — “this customer says they did not receive my reply” — requires reading the Exim logs with the right filters, in the right order. There are two files that matter: mainlog for what Exim accepted and delivered, and rejectlog for what it refused at the SMTP gate. Reading them together gives the whole story.
What’s happening
Each message in Exim gets a unique ID (1nXXXX-000XXX-XX) at acceptance. Every line referring to that message includes the ID, which lets you grep one conversation out of thousands of interleaved lines. mainlog shows accept (<=), forward (->), defer (==), bounce (**), and complete (Completed). rejectlog shows the SMTP-level refusals: blocked IPs, rejected senders, rejected recipients, rejected by ACL. If you cannot find a message in mainlog, it was probably rejected at the gate and lives only in rejectlog.
How to verify
The standard grep paths:
# everything Exim accepted in the last hour for the sender
grep "from=<sender@example.com>" /var/log/exim_mainlog | tail
# trace a specific message by ID
grep "1nXXXX-000XXX-XX" /var/log/exim_mainlog
# rejections for an IP or sender
grep "from=<bad@spam.com>" /var/log/exim_rejectlog
# delivery failures
grep "**" /var/log/exim_mainlog | tail -50
# defers (queued, will retry)
grep "==" /var/log/exim_mainlog | tail -50
# current queue
exim -bpc
exim -bp | head
For real-time:
tail -f /var/log/exim_mainlog
tail -f /var/log/exim_rejectlog
The fix
- Trace a message — get the ID from either end (
Message-Idheader, or the bounce response). Grepexim_mainlogfor the ID: you will see one acceptance line, one or more delivery attempts, and a completion or bounce. - Message not in mainlog — check
rejectlog. If rejected at SMTP for “not in our list of allowed rcpthosts”, the recipient does not exist on this server. If rejected for “Permission denied”, the IP is blocked. - Defers —
==lines mean Exim tried, the remote was unavailable, and Exim will retry. Default retry schedule is in/etc/exim.conf. Persistent defers to one destination indicate a remote problem; persistent defers from one sender indicate a local one. - Bounces —
**lines have a reason. “User unknown” means the recipient does not exist; “Greylisted” means temporary deferral by remote; “Spam score too high” means SpamAssassin or rspamd blocked. - Per-user mail log —
/home/<user>/etc/<domain>/mail.logshows just the user’s mail, if you have set up per-user logging. Easier to read than the global.
For deeper analysis, exigrep <pattern> /var/log/exim_mainlog groups all lines for messages matching the pattern. Stack Harbor handles mail-flow triage under cPanel/WHM management — start a conversation when delivery issues recur.