You've checked the usual suspects: ports 25, 465, and 587 are open, authentication works in Roundcube, and the Exim service shows green in WHM. Mail still won't leave the server.
This happens more than you'd think. The surface-level checks pass, yet outbound delivery fails silently or lands in a frozen queue. I've traced these failures to everything from misconfigured router ACLs in Exim to subtle DNS propagation gaps that only affect certain recipient domains. What follows are eight diagnostic and tuning steps that assume you've already restarted services and verified credentials.
Check the Exim main log with context-aware filters
The Exim main log at /var/log/exim_mainlog will show you why delivery failed, but parsing it efficiently matters when you're handling thousands of lines per hour.
Instead of grepping for a single sender address, search for the message ID and follow its entire lifecycle:
grep '1a2B3c-0004Xy-Z9' /var/log/exim_mainlog
You'll see the arrival, any ACL denials, attempted delivery, and final disposition. If the message shows frozen status, the logs will tell you why Exim stopped trying—common reasons include bounce loops, unrouteable domains, or hitting retry time limits.
For real-time monitoring during a test send, tail the log and filter by your test recipient:
tail -f /var/log/exim_mainlog | grep '[email protected]'
Pay attention to lines containing == (delivery deferred) or ** (delivery failed). The error message immediately after those symbols is your smoking gun.
Audit Exim's ACL router and transport configuration
Exim's power comes from its ACL (Access Control List) system, but a single misconfigured router or transport can silently drop or defer mail. If you've customized /etc/exim.conf or added custom ACLs in WHM, check the routers section for anything that might match your outbound mail incorrectly.
Run an Exim configuration test in debug mode against a real message:
exim -d -bt [email protected]
This dry-run shows which router Exim will use and whether any conditions fail. Look for lines like declined by or passed to. If a custom router is catching your mail before the standard lookuphost router, that's your bottleneck.
In support tickets I handled, the usual culprit was a custom send_via_relay router that required authentication but didn't have fallback logic when the relay was down. The mail sat in the queue indefinitely.
Another edge case: a transport using return_fail_output might suppress error messages, making it look like mail vanished. Check your transport definitions in the transports section of the config for any return_output = false or temp_errors settings that hide failures.
Inspect SPF and DKIM signing at the MTA level
You might assume that because WHM's Email Deliverability interface shows green checkmarks, your SPF and DKIM are working. Not always true.
Send a test email to a Gmail or Outlook account you control and examine the full headers. Look for the Authentication-Results header. If you see spf=neutral or dkim=fail, the issue is at the signing or DNS level, not with the remote server's policies.
To verify DKIM signing is actually happening on outbound mail, check the headers of a message in the Exim queue:
exim -Mvh <message-id>
You should see a DKIM-Signature: header. Missing? The dkim transport isn't being invoked. Check /etc/exim.conf for the remote_smtp transport and confirm it includes:
dkim_domain = ${lc:${domain:$h_from:}}
dkim_selector = default
dkim_private_key = /var/cpanel/domain_keys/private/${dkim_domain}
If the private key path is wrong or permissions are too restrictive (anything other than 0600 owned by mailnull), signing fails silently.
For SPF, don't just check the record exists—verify it's not too long. SPF has a 10-DNS-lookup limit. If your record includes multiple include: mechanisms that themselves contain includes, you'll hit that limit and the entire SPF check fails. Use an SPF record flattening tool or simplify your includes.
Analyze the retry database for deferred delivery patterns
Exim maintains a retry database at /var/spool/exim/db/retry that tracks failed delivery attempts and schedules retries. If a domain has been marked as unreachable, Exim won't try again until the retry timer expires.
Dump the retry database to see what's being deferred:
exim_dumpdb /var/spool/exim retry
You'll get lines like:
T:example.com: 2026-09-27 01:30:15 127.0.0.1 SMTP timeout
The T: prefix means a temporary failure for that domain. If you're seeing repeated timeouts or connection refusals to the same domain, the issue might be on their end—but it could also be your server's IP getting rate-limited or blocked.
To force an immediate retry for a specific domain, remove its entry from the retry database:
exim_tidydb /var/spool/exim retry
Then flush the queue for that domain:
exim -qff -R example.com
Watch the main log. If delivery succeeds now, the retry backoff was the only blocker.
Test SMTP handshake manually with OpenSSL
Automated tools hide details. Testing the SMTP handshake manually reveals TLS negotiation failures, protocol mismatches, and authentication bugs that don't show up in logs.
Connect to your server's SMTP port with OpenSSL:
openssl s_client -connect yourdomain.com:465 -crlf
For STARTTLS on port 587:
openssl s_client -connect yourdomain.com:587 -starttls smtp -crlf
Once connected, run through the SMTP conversation manually:
EHLO yourdomain.com
AUTH LOGIN
<base64-encoded-username>
<base64-encoded-password>
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
Subject: Test
Test message body.
.
QUIT
If authentication fails, check the exact error code. A 535 error means wrong credentials, but a 454 often means TLS is required but not being offered. A 550 during RCPT might indicate the recipient domain is blacklisting your IP.
This test also reveals certificate issues. If the OpenSSL handshake shows Verify return code: 21 (unable to verify the first certificate), your certificate chain is incomplete and some recipients will reject your mail.
So what if the queue is full but nothing moves?
A frozen queue is a different beast. Messages pile up, Exim processes run, but nothing delivers.
First, check queue length:
exim -bpc
If you're seeing thousands of messages, list the frozen ones:
exim -bp | grep frozen
To see why messages are frozen:
exim -Mvl <message-id>
Common freeze reasons:
- Bounce loops (message bounced, bounce bounced back, frozen)
- Sender verification failures when verify = sender is enabled
- Messages exceeding message_size_limit
If the frozen messages are all bounce loops, delete them in bulk:
exim -bp | grep frozen | awk '{print $3}' | xargs exim -Mrm
Be careful. That removes messages permanently.
Another scenario: the queue runner isn't processing fast enough. Check your queue_run_max setting in /etc/exim.conf. Default is often 5 concurrent queue runners. If you're on a beefy VPS with hundreds of outbound messages, increase it:
queue_run_max = 20
Restart Exim and watch CPU load. More runners means more parallel delivery attempts but higher resource usage.
Verify sender domain ownership and mailbox existence
Exim can be configured to verify that the sender's domain exists and has valid MX records before accepting mail. If this check is too strict, it'll reject mail from domains with unusual DNS setups.
Search /etc/exim.conf for:
require verify = sender
If present in the acl_check_mail or acl_check_rcpt sections, it means Exim is doing a callback verification. The sending domain must have a working MX record and the mailbox must exist (or the remote server must not reject the verification probe).
In practice, some legitimate domains fail this check because they use strict anti-callback policies. If you're seeing deferrals with errors like Sender verify failed, consider softening the check:
warn verify = sender
Changing require to warn logs the failure but doesn't block the mail.
Also check for callout verifications:
require verify = sender/callout=30s
These actively connect to the recipient's mail server and verify the address exists. Aggressive and slow. If you don't need that level of verification, remove it.
Trace firewall rules and rate-limiting at the OS level
Exim might be working perfectly, but iptables or CSF (ConfigServer Security & Firewall) could be rate-limiting outbound SMTP connections.
Check active iptables rules for anything affecting port 25:
iptables -L -n -v | grep :25
If you see REJECT or DROP rules, find out why they're there. A common CSF default is limiting outbound SMTP connections per IP to prevent spam. Check /etc/csf/csf.conf for:
CT_LIMIT
CT_PORTS
If CT_PORTS includes 25 and CT_LIMIT is set low (like 20), your server will drop new SMTP connections once that threshold is hit. Legitimate bulk senders hit this all the time.
Raise the limit or add your server's own IP to the ignore list in /etc/csf/csf.ignore.
Another edge case: some hosting providers silently block outbound port 25 at the network level to prevent abuse. If your server is on a cloud VPS or shared infrastructure, test with:
telnet smtp.gmail.com 25
If it times out or is refused, the block is upstream. You'll need to use an authenticated relay on port 587 instead.
Tune Exim's retry and timeout settings for modern networks
Default Exim retry and timeout values were designed for slower internet connections. Modern networks fail faster, but Exim might still be waiting too long or retrying too aggressively.
Key settings in /etc/exim.conf:
smtp_connect_timeout = 1m
smtp_data_timeout = 5m
retry_interval_max = 4h
If you're seeing timeouts to known-good domains, try lowering smtp_connect_timeout to 30s. A full minute is often overkill.
For the retry schedule, check the retry section of the config. The default might look like:
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
This says: retry every 15 minutes for the first 2 hours, then every hour (with 1.5x backoff) for 16 hours, then every 6 hours for 4 days. If you're handling time-sensitive transactional mail, you might want faster initial retries:
* * F,1h,5m; G,8h,30m,1.5; F,2d,6h
Be cautious. Aggressive retries can get your IP flagged as a spammer by some mail systems.
How do I find which message is stuck in the queue?
Run exim -bp to list all queued messages. Look for the ones with the longest queue time or frozen status. Use exim -Mvh <message-id> to see headers and exim -Mvb <message-id> to see the body.
Why does mail send from Roundcube but not from my application?
Roundcube uses authenticated SMTP through the server's local MTA. Your application might be trying to send via mail() or a different SMTP route. Check your application's mail configuration and ensure it's authenticating properly.
Can I force Exim to use a specific outbound IP?
Yes. In the remote_smtp transport, add interface = your.ip.address.here. Useful if your server has multiple IPs and one has better reputation.
What does "all relevant MX records point to non-existent hosts" mean?
The recipient domain's MX records point to hostnames that don't resolve. Either their DNS is broken or they don't accept mail. Nothing you can do except notify the domain owner.
What to verify when the obvious checks pass
Start with the Exim main log and trace the message lifecycle by ID. Test your SMTP handshake manually with OpenSSL to catch TLS and authentication failures that automated tools miss. Audit your ACL routers for custom logic that might be catching mail incorrectly, and confirm SPF and DKIM are signing at the MTA level by inspecting actual headers.
If the queue is frozen or deferred, dump the retry database to see which domains Exim has given up on temporarily. Check for firewall-level rate limiting in iptables or CSF that might be dropping connections before Exim even sees them. Finally, tune Exim's retry schedule and timeout settings to match modern network speeds and your delivery SLA.
These fixes won't make sense until you hit the specific edge case they solve. When you do, you'll know exactly where to look.
