
In this guide
- What causes an Exim email queue backlog?
- Step 1: Check the Exim email queue size
- Step 2: Find the reason emails are delayed
- Step 3: Check deferred or frozen messages
- Step 4: Fix the underlying delivery problem
- Step 5: Retry messages safely
- Step 6: Remove unwanted messages
- Step 7: Verify delivery recovery
- Prevent future backlogs
- Frequently asked questions
Introduction
An Exim email queue backlog occurs when outgoing messages remain queued instead of reaching their intended recipients. In a cPanel or WHM environment, this can delay customer emails, website notifications, password-reset messages, order confirmations, and other business-critical communications.
A growing queue does not always indicate that Exim itself is malfunctioning. Messages may be waiting because a recipient’s mail server is temporarily unavailable, DNS resolution is failing, the sending IP has a reputation problem, or the server has reached a resource or delivery limit.
The correct way to fix an Exim email queue backlog is to identify the reason for delayed delivery, resolve the underlying problem, and then allow Exim to retry affected messages.
This guide explains how to investigate an Exim queue backlog using WHM, SSH, and practical Linux commands without accidentally deleting legitimate email.
What causes an Exim email queue backlog?
Exim is the mail transfer agent commonly used on cPanel servers. It queues messages when they cannot be delivered immediately and may retry delivery according to its configured retry rules.
Common causes include:
- Remote mail server failures: The recipient’s mail server is unavailable or temporarily rejecting connections.
- DNS resolution problems: The server cannot resolve the recipient domain’s MX records or associated mail-server addresses.
- SMTP rate limits: A recipient provider temporarily limits messages from the sending server.
- Email authentication or reputation issues: SPF, DKIM, DMARC, reverse DNS, or IP reputation problems contribute to delivery failures.
- Excessive outbound email: A compromised mailbox, vulnerable website, or poorly configured application generates an unusually high volume of messages.
- Resource exhaustion: Disk space, memory, CPU, or other system limits interfere with mail processing.
- Frozen messages: Exim has suspended delivery attempts for messages that cannot be delivered under the applicable conditions.
The queue’s delivery errors and mail logs help distinguish these causes. Deleting queued messages without diagnosing them may hide the symptoms while leaving the underlying problem unresolved.
Step 1: Check the Exim email queue size
Connect to the server using SSH as root or open an authorized root-level terminal in WHM.
Run:
exim -bpc
This command displays the total number of messages currently in the Exim queue.
Next, inspect the queue:
exim -bp
The output includes message IDs, message sizes, queue age, sender information, recipients, and frozen status where applicable.
To identify the number of frozen messages, run:
exiqgrep -iz | wc -l
To display messages that are not frozen:
exiqgrep -ix
How to interpret the results
- A small queue with recent messages may be normal.
- A queue that continues growing may indicate a delivery problem or excessive message generation.
- Many messages addressed to the same recipient domain may indicate a problem with that provider.
- Numerous frozen messages may point to rejected messages, failed delivery attempts, or unwanted outbound mail.
Compare the queue size with recent server activity. One high queue count alone does not establish that the mail service is broken.
Step 2: Find the reason emails are being delayed
The next step is to inspect the Exim main log.
On a typical cPanel server, the main log is located at /var/log/exim_mainlog.
Display recent entries:
tail -n 100 /var/log/exim_mainlog
To monitor new log activity:
tail -f /var/log/exim_mainlog
Press Ctrl+C to stop live monitoring.
Look for delivery errors such as:
Note: These log patterns are diagnostic clues. Always review the surrounding Exim log entries and the complete SMTP response before applying a fix.
These are diagnostic clues, not definitive diagnoses. Interpret the complete log entry and the remote server’s response before choosing a fix.
Investigate a specific message
Copy a message ID from exim -bp and inspect its headers:
exim -Mvh MESSAGE_ID
Replace MESSAGE_ID with the actual ID.
To review the message body, if required and authorized:
exim -Mvb MESSAGE_ID
Message bodies can contain confidential information, so do not share their output publicly.
Search the main log for activity associated with a particular message:
exigrep 'MESSAGE_ID' /var/log/exim_mainlog
These checks help identify the recipient, the delivery attempt, and the reason Exim has retained the message.
Step 3: Check whether the queue contains deferred or frozen messages
Deferred messages are waiting for another delivery attempt. Frozen messages have had delivery attempts suspended.
To display frozen messages:
exiqgrep -iz
To display non-frozen messages:
exiqgrep -ix
If many messages are frozen, examine their associated log entries before taking action. A frozen message might be legitimate email that encountered a rejection, or it might be an unwanted message generated by a compromised account.
Do not automatically delete all frozen messages. First identify their senders, recipients, age, and failure reasons.
For an individual message that has a confirmed, resolved delivery problem, a targeted retry may be appropriate. Confirm the cause and review the consequences before triggering delivery.
Step 4: Fix the underlying delivery problem
The correct solution depends on the evidence collected from the queue and logs.
A. Resolve DNS lookup failures
If Exim reports DNS lookup failures, test the recipient domain’s mail records:
dig MX example.com
Replace example.com with the actual recipient domain.
Check the returned mail host’s address records when needed:
dig A mail.example.com
dig AAAA mail.example.com
Use the actual mail host returned by the MX lookup.
If the results indicate a DNS problem, check the configured resolvers, DNS reachability, and the domain’s records. An absent AAAA record is not automatically an error, and not every destination uses IPv6.
Correct the actual DNS issue before attempting to force delivery.
B. Investigate remote SMTP rejections
If the recipient server returns an SMTP error, read the complete response. Temporary errors often require waiting for the destination service to recover or for a rate limit to expire.
Permanent errors may require correcting the recipient address, sender configuration, email authentication, or another issue identified by the rejection.
Do not repeatedly force delivery to a destination that continues rejecting messages.
C. Check sending reputation and email authentication
If multiple recipient providers reject messages from the same server, inspect:
- The sending IP’s reputation and relevant blocklist status.
- SPF records and whether the sending IP is authorized.
- DKIM signing and signature validation.
- DMARC policy alignment.
- Reverse DNS and the server’s SMTP hostname.
- Outbound mail volume and provider-specific sending limits.
Correct the issue indicated by the available evidence. Avoid changing DNS records without first understanding the domain’s existing email configuration.
D. Investigate excessive outbound mail
If the queue contains a large volume of messages from one account or domain, investigate before attempting to clear the queue.
Check for compromised mailboxes, vulnerable website scripts, unauthorized SMTP credentials, and unexpected application-generated email. Review account-level mail statistics and relevant Exim logs.
If abuse is confirmed, contain the source using the appropriate account-level or security controls, reset compromised credentials, and remediate the vulnerable application. Preserve relevant logs for investigation.
E. Check server resources
Run:
df -h
df -i
free -h
uptime
These commands show filesystem capacity, inode usage, available memory, and system load.
If a filesystem is full, identify the files consuming space before removing anything. Do not delete Exim spool files manually, because doing so can corrupt the queue or cause message loss.
Step 5: Retry messages after resolving the cause
Once the underlying problem is corrected, allow Exim’s normal retry mechanism to process eligible messages.
To initiate a normal queue run:
exim -q
This requests a queue run while respecting normal retry timing and excluding frozen messages from ordinary delivery attempts.
For one specific message, you can request an immediate delivery attempt:
exim -M MESSAGE_ID
Use the message-specific command only after verifying the message and resolving its delivery problem. It can trigger delivery immediately and may bypass the normal retry timing for that message.
After the attempt, inspect the relevant logs and queue status again:
exim -bpc
tail -n 50 /var/log/exim_mainlog
A successful queue run does not guarantee that every message will be delivered. Messages destined for unavailable servers or addresses that continue to be rejected may remain queued or eventually fail according to Exim’s configured retry rules.
Step 6: Remove only messages confirmed to be unwanted
Queue cleanup should be the last step, not the first.
If you have confirmed that specific messages are unwanted and are authorized to remove them, use their message IDs:
exim -Mrm MESSAGE_ID
This removes the selected message without sending a bounce notification. The message cannot be recovered through the queue after removal.
To remove all frozen messages, cPanel documents the following command:
exiqgrep -iz | xargs -r exim -Mrm
Warning: This command removes all messages matching the frozen-message filter, potentially including legitimate customer email. Review the selected messages and obtain appropriate authorization before running it.
Never run a command to delete the entire queue simply because the queue count is high. That can permanently discard important mail without resolving the reason the backlog developed.
Step 7: Verify that email delivery has recovered
After remediation, confirm that the queue is decreasing and that recent delivery attempts are succeeding.
Use:
exim -bpc
Then inspect the latest mail log entries:
tail -n 100 /var/log/exim_mainlog
Send a controlled test email to an address you manage and verify its delivery. If possible, test more than one recipient provider when the original issue affected multiple destinations.
For a healthy recovery, look for:
- A queue that is stable or decreasing.
- Successful delivery entries for previously affected destinations.
- No continuing growth in deferred or frozen messages.
- No repeated errors from the original failure.
- No unexplained surge in outbound mail volume.
If the queue grows again, return to the logs and investigate the recurring cause instead of repeatedly forcing delivery or deleting messages.
Prevent future Exim queue backlogs
Preventive monitoring can reduce the impact of future delivery problems.
Monitor queue growth. Track the total queue count and the age of the oldest messages. Alerting thresholds should reflect normal traffic for the server.
Review delivery failures. Investigate recurring SMTP errors, DNS failures, and provider-specific rejections.
Secure outbound email. Use strong mailbox passwords, secure SMTP authentication, current applications, and appropriate outbound mail controls.
Monitor server resources. Maintain adequate disk space, inode capacity, memory, and CPU availability.
Maintain correct email authentication. Review SPF, DKIM, DMARC, and reverse DNS whenever sending infrastructure changes.
Keep cPanel and Exim maintained. Apply supported updates and follow the platform’s recommended configuration and security practices.
Document recovery procedures. Keep a clear record of the commands, findings, and corrective actions used during mail delivery incidents.
When to contact a server management team
Escalate the incident when the queue continues growing despite remediation, several domains are affected, delivery errors indicate a server-wide issue, or you suspect compromised accounts or a mail abuse incident.
A qualified server management team can analyze Exim logs, identify account-level mail sources, investigate DNS and SMTP connectivity, verify server resources, and implement appropriate fixes while protecting legitimate queued email.
ActSupport provides server management and technical support for businesses that need help investigating Linux hosting, cPanel, email delivery, and infrastructure issues.
Need Help Resolving an Exim Queue Backlog?
Persistent email delivery problems can affect customer communications and business operations. ActSupport can help investigate cPanel, Linux server, and email delivery issues.
Conclusion
An Exim email queue backlog is a symptom, not a diagnosis. The most effective approach is to inspect the queue, identify the delivery failure in the logs, resolve the underlying cause, and verify that messages are moving again.
By combining targeted Exim commands with careful DNS, SMTP, resource, and security checks, administrators can restore email delivery while avoiding unnecessary message loss.
If your cPanel server continues experiencing email delivery delays, ActSupport can help investigate the underlying mail server and hosting infrastructure issues.
Frequently Asked Questions
Find answers to common questions about Exim email queue backlogs, cPanel mail delivery, and troubleshooting.
ActSupport · cPanel, Linux server management, and email delivery troubleshooting
