When the obvious checks come up clean
You've verified port 25 and 587 are open. Authentication works in Roundcube. SPF and DKIM records exist in DNS. Yet mail still won't leave the server, or it leaves but never arrives. The usual "check your password" articles miss the edge cases that break email in production: rate-limit thresholds tripped by a single WordPress plugin, DKIM signatures that pass validation but fail alignment, greylist loops that look like blackholes, and IP reputation damage invisible to most diagnostics.
I've cleared hundreds of stuck queues where the root cause sat three layers below the error message. This guide covers the moves that separate a two-day ticket from a ten-minute fix.
1. Inspect the Exim paniclog before anything else
The mainlog shows routine traffic. The paniclog shows why Exim stopped processing certain messages. Most administrators never look at it.
tail -n 50 /var/log/exim_paniclog
A non-empty paniclog means Exim hit a condition it couldn't handle: malformed headers, disk writes that failed mid-spool, or database lookups that timed out. If you see repeated "failed to expand" errors, a macro in your Exim config references a missing file or an undefined variable.
Common panic triggers:
- Permissions on /var/spool/exim/input or /var/spool/exim/msglog changed by a careless script
- A custom ACL that calls an external binary no longer in $PATH
- Mailman or another integration writing malformed Received: headers
Fix the underlying cause, then force a queue run:
exim -qff
The -qff flag tells Exim to retry every message, even those marked as frozen. Watch the mainlog live while it runs:
tail -f /var/log/exim_mainlog
If dozens of messages suddenly deliver, the paniclog condition was your bottleneck.
2. Unfreeze messages trapped by temporary lookup failures
Exim freezes messages when a temporary error (DNS timeout, greylisting defer, recipient verify callout failure) hits the retry limit. Frozen messages sit in the queue forever unless you intervene.
List frozen message IDs:
exim -bp | grep frozen | awk '{print $3}'
To thaw and attempt delivery on all frozen messages:
for id in $(exim -bp | grep frozen | awk '{print $3}'); do exim -Mt $id; done
exim -qff
In support tickets I handled, frozen queues often resulted from a DNS resolver outage hours earlier. Messages sent during the outage froze; new messages after the resolver came back delivered fine. Operators saw "some mail works, some doesn't" and assumed authentication issues. Unfreezing cleared the backlog instantly.
If messages refreeze immediately, read the delivery logs for that message ID:
exim -Mvl <message-ID>
The log shows every retry attempt and the exact defer reason.
3. Check per-user and per-domain rate limits in Exim config
CPanel's Exim configuration includes rate-limiting ACLs that count messages per hour per authenticated user and per domain. A compromised account sending spam will hit these limits, but so will a legitimate WordPress site with ten form plugins all firing transactional mail.
Find the rate-limit ACLs:
grep -A 5 "ratelimit" /etc/exim.conf
Typical cPanel installs enforce: - Authenticated users: usually around 200-500 messages per hour - Per-domain: often 1000-2000 messages per hour
When a user hits the limit, Exim defers their mail with 451 Temporary local problem. The mainlog shows:
451 Sender rate exceeded
If your WordPress install sends 50 emails every time someone submits a contact form (CC'd to six departments, each triggering an autoresponder), you'll hit 200 messages in minutes.
Temporary fix—lift the limit for a specific user:
- Edit
/etc/exim.confor use WHM's Exim Configuration Manager - Add the user to a whitelist in the rate-limit ACL, or increase the threshold
- Restart Exim:
systemctl restart exim
Permanent fix: audit the application's mail behavior. Transactional mail should batch notifications or queue them in a proper background job system, not fire synchronously.
4. Diagnose DKIM alignment failures that pass validation
Your DKIM signature validates (you tested with dig and an online checker), but Gmail or Outlook still rejects the mail. The issue is often alignment, not validity.
DMARC requires that the d= domain in the DKIM signature matches the From: header domain (or an organizational domain parent). If your Exim signs with d=server.example.com but the From: header says [email protected], the signature is valid but not aligned.
Check what domain Exim is signing with:
grep "dkim_domain" /etc/exim.conf
CPanel's default signing behavior uses the server hostname, not the sender's domain. You need to override it.
In WHM, go to Exim Configuration Manager → Advanced Editor and find the DKIM_SIGN section. Change:
dkim_domain = ${lc:${sender_address_domain}}
This tells Exim to sign using the domain from the From: address. Restart Exim, send a test message, and check the raw headers. The DKIM-Signature: d= value should now match your From: domain.
If you manage multiple domains and only some have DKIM keys installed, add a conditional:
dkim_domain = ${if exists{/var/cpanel/domain_keys/private/${lc:${sender_address_domain}}} {${lc:${sender_address_domain}}} fail}
This prevents Exim from trying to sign mail for domains without keys.
5. Escape greylist loops caused by IP rotation
Greylisting defers mail on first contact, expecting the sender to retry from the same IP. If your server retries from a different IP each time (common with multi-IP servers or load-balanced MTAs), the receiving server sees every retry as a new "first contact" and defers indefinitely.
Symptoms:
- Mail to the same recipient domain defers for hours
- Each retry shows a 450 Greylisted or 451 Try again later response
- The retry attempts come from different source IPs
Check your Exim outbound IP behavior:
grep "interface" /etc/exim.conf
If you see:
interface = <; ${if exists{/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}}}{$primary_hostname}}
...Exim is using /etc/mailips to rotate IPs per domain. This breaks greylisting. Force a single outbound IP:
echo "*: 203.0.113.45" > /etc/mailips
Replace 203.0.113.45 with your server's primary IP. Restart Exim and retry the stuck messages.
Alternatively, configure the queue_smtp_domains option to defer retry attempts for greylisting domains to a longer interval, giving the greylist time to expire without rotating IPs.
6. Query your IP against major blacklists that matter
Most RBL checkers test 30+ lists, but only five actually block your mail at major providers: Spamhaus ZEN, Barracuda, SORBS, Spamcop, and UCEPROTECT. The rest are noise.
Manual checks:
dig +short 45.113.0.203.zen.spamhaus.org
dig +short 45.113.0.203.b.barracudacentral.org
Reverse your IP octets before appending the RBL domain. If you get a 127.0.0.x response, you're listed.
Spamhaus listings usually mean either: - Your IP was previously owned by a spammer (contact Spamhaus for delisting) - Outbound mail volume spiked and triggered automated listing
Barracuda often lists IPs with poor reverse DNS or missing SPF. Fix rDNS first:
dig +short -x 203.0.113.45
If the PTR record doesn't resolve to a domain that matches your forward DNS, major providers penalize you. Update your PTR through your hosting provider's control panel or IP management interface.
After fixing the root cause (compromised account, missing rDNS, etc.), request delisting directly from each RBL's website. Spamhaus and SORBS auto-delist after 24-48 hours if you fix the issue; others require manual requests.
So what if your queue shows no errors but mail never arrives?
Check the Exim routing logs for the message. Sometimes mail leaves your server successfully but dies silently at the next hop.
exim -d -bt [email protected]
The -bt flag performs address testing and shows how Exim would route the message. If it routes to a smarthost or relay, verify that relay is actually forwarding your mail.
For messages already in the queue:
exim -Mvc <message-ID>
This displays the full message body and headers without attempting delivery. Check for:
- Malformed Message-ID headers (some filters auto-reject)
- Missing Date: headers
- From: addresses that don't match any domain you control
WordPress plugins and PHP mailers occasionally generate headers that technically violate RFC 5322 but work with most servers. When you hit a strict receiving MTA, they bounce silently.
7. Disable or tune SMTP callout verification
Some cPanel admins enable recipient verification callouts in Exim ACLs. This checks whether the recipient address exists by connecting to the destination MTA and running RCPT TO. Sounds smart; breaks constantly.
Problems: - Greylisters defer callouts, which Exim interprets as "address doesn't exist" - High-volume senders see their server IP blocked by destination MTAs for making too many connections - Callout results get cached, so a temporary DNS failure marks an address as invalid for hours
Find callout ACLs:
grep -i "verify.*callout" /etc/exim.conf
If present, comment them out or reduce the aggressiveness:
# verify = recipient/callout=10s,defer_ok,use_sender
The defer_ok option tells Exim to accept mail even if the callout defers (greylist), and use_sender makes callouts come from the actual sender address, not <>, which some servers reject.
Better approach: skip callouts entirely and rely on post-delivery bounce handling. False negatives (accepting mail for invalid addresses and bouncing later) are preferable to false positives (rejecting valid mail).
8. Trace the full SMTP conversation for weird authentication behavior
When a client says "authentication works in webmail but not Outlook," the issue is usually SASL mechanism mismatch or TLS version negotiation.
Enable full SMTP conversation logging temporarily:
echo "+smtp_connection +smtp_protocol_error +all" > /etc/exim_debug
systemctl restart exim
Watch the mainlog during a failed send attempt. You'll see the full SMTP dialog, including what the client offered and what Exim accepted.
Common issues:
- Outlook tries CRAM-MD5 but your Exim only advertises LOGIN and PLAIN
- Client requires STARTTLS but connects to port 25, which allows unencrypted AUTH
- TLS handshake fails because the client requires TLS 1.2+ and your OpenSSL version is ancient
For TLS version problems:
openssl version
If you're on OpenSSL 1.0.x or earlier, upgrade the OS. For Red Hat/CentOS 7, you may need to migrate to AlmaLinux 8 or Rocky Linux 8 since CentOS 7's OpenSSL is stuck at 1.0.2.
Disable SMTP debug logging when done:
rm /etc/exim_debug
systemctl restart exim
Leaving it on generates gigabytes of logs under load.
What to check first
Start with the paniclog—it surfaces conditions other logs don't. Unfreeze stuck messages before assuming a connectivity problem. Check alignment, not just validation, for DKIM and SPF. Verify you're sending from a consistent IP to avoid greylist loops. When mail leaves successfully but vanishes, the problem is usually downstream reputation or header formatting.
Edge cases kill more mail than misconfigured ports. Most "email not sending" problems in cPanel trace back to rate limits, frozen queues, or alignment mismatches—all invisible to basic diagnostic tools. Fix those three and you'll clear 80% of advanced cases.
