Blog
SavedSearch
Visit Hostlelo

Read the Exim Mail Queue on cPanel: Spot Spam and Bounces

Email slow or never arrived? Count and read the Exim queue on cPanel, spot spam runs and bounce floods, and clear them safely with WHM or Track Delivery.

The short answer

Run `exim -bpc` as root to count the Exim mail queue in seconds: a number that keeps climbing or never moves means something is stuck or sending too much. Use `exim -bp` with `exiqsumm` to see which senders and domains fill the queue, where bounces show an empty sender. cPanel account owners without root can check their own recent mail in Track Delivery. Deleted queue messages cannot be recovered, so save the listing and inspect samples first.

Exim mail queue workflow separating legitimate mail from suspicious messages before deletion
Reading options

On this page

Before you start

Root or delegated WHM mail-queue access; a saved queue listing; confirmed message IDs and headers; evidence that the source account or script has been contained; awareness that deleted queued mail cannot be recovered.

When a customer says email is slow, or a client swears your invoice never arrived, the first thing to check is the Exim mail queue on your cPanel server. One command gives you the count in about ten seconds, and that number tells you whether the server is stuck or just busy.

By the end of this guide you will be able to count the queue, read what is in it, spot spam runs and bounce floods, and decide calmly what to keep, retry or remove.

What the mail queue actually is

Exim is the mail server software that cPanel uses to send and receive email. The mail queue is the list of messages Exim has accepted but has not yet finished delivering.

Think of a post office sorting shelf. Most letters land on the shelf and leave within minutes. A few sit there because the address is wrong or the receiving post office is closed, and the clerk keeps trying them later.

A healthy shelf empties on its own. A shelf piled to the ceiling with letters all from one sender, or with returned letters nobody wants, is the picture you are looking for.

Two words you will see a lot. A bounce is an automatic "could not deliver" notice sent back to the sender. A frozen message is one Exim has stopped trying to deliver for now.

Before you start

Run through this list before you touch anything.

  • Know your role. If you have root access to WHM or SSH, you can use every tool below. If you only have a cPanel account, you get Track Delivery, which is covered in its own section.
  • Confirm root for the command line. The cPanel documentation says you must have root-level permissions for the Exim queue commands, and that you should contact your hosting provider if you do not.
  • Have an SSH session open as root, and know which server you are on.
  • Save a copy of the current queue listing before you change anything. The command is in Step 2.
  • Know where the main log lives: /var/log/exim_mainlog. You will read it, not edit it.
  • Understand the risk. Counting and reading the queue is safe. Deleting is permanent: the cPanel documentation states plainly that you cannot recover deleted emails.

Why this matters: most queue problems are solved by reading, not deleting. If you go in expecting to look first and act second, you will rarely regret anything.

Read the queue from the command line (WHM root)

This is the fastest route when someone is waiting on the phone.

Step 1: Count the queue

This command counts the messages currently in the queue and prints a single number.

exim -bpc

You should see one line with a number, such as 14 or 3200. There is no magic "normal" figure, because a busy server with many accounts carries more mail than a quiet one.

Quick tip: run it twice, a minute or two apart. A number that drops means Exim is working through a busy period. A number that climbs steadily, or never moves, means something is stuck or something is sending far too much.

Step 2: Save a copy of the queue and list it

This command lists every message in the queue and writes the listing to a file in root's home directory, so you have a record before you change anything.

exim -bp > /root/queue-before.txt

Nothing prints to the screen; the file now holds the full listing.

This command prints the same listing to the screen so you can read it directly.

exim -bp

You will see blocks like the one below. The first line shows how long the message has waited, its size, its message ID, and the envelope sender. The lines under it are the recipients.

2h  4.1K 1abcDE-0001xy-AB <billing@example.com>
          client@example.com

A message ID is Exim's unique label for one message, such as 1abcDE-0001xy-AB. You will copy and paste these IDs into the commands that follow.

A few markers matter when reading this list. A sender shown as <> is a bounce, because the Exim specification says bounce messages have an empty sender. The text *** frozen *** at the end of the first line means delivery attempts are suspended. A D next to a recipient means that copy has already been delivered.

Step 3: Summarise the queue by domain

This command passes the listing to exiqsumm, a helper script that ships with Exim, and prints one line per destination domain.

exim -bp | exiqsumm

Each line shows the number of pending deliveries for a domain, their total size, and how long the oldest and newest messages have waited. A summary line follows at the end.

This version sorts the summary by message count instead of by domain name.

exim -bp | exiqsumm -c

Heads up: the count of pending deliveries can be higher than the message count, because one message with five recipients counts as five deliveries.

This version separates bounce messages from the rest, which is the quickest way to see whether bounces are filling the shelf.

exim -bp | exiqsumm -b

This version separates messages by sender, which is how you spot one account sending far more than everyone else.

exim -bp | exiqsumm -s

Step 4: Find frozen messages

This command uses exiqgrep, another Exim helper, to show only the count of frozen messages.

exiqgrep -z -c

You will see a count of matching messages. Compare it with the total from Step 1: when frozen mail makes up a large share of the queue, there is a pattern worth investigating.

This command lists the IDs of frozen messages only, one per line, so you can inspect them.

exiqgrep -z -i

Step 5: Look inside one message

This command prints the headers of one message, which show who it claims to be from, the subject, and the route it took.

exim -Mvh 1abcDE-0001xy-AB

You will see the stored header lines for that message. For spam, look at the sender address and the subject line, and ask whether a real person on that account would plausibly write it.

This command prints the message log for one message, which records each delivery attempt and the reason it failed or was deferred.

exim -Mvl 1abcDE-0001xy-AB

You should see timestamped lines. The deferral reason from the receiving server is often the whole answer.

Quick tip: there is also exim -Mvb, which prints the message body. Use it only when the headers are not enough, because you are reading a customer's private mail.

Step 6: Search the main log for one message

This command uses exigrep to pull every log line belonging to messages that match your pattern from the main log, so you see the full history in one place.

exigrep 1abcDE-0001xy-AB /var/log/exim_mainlog

You will see the arrival line and every delivery attempt for that message, grouped together.

Spot spam and bounce floods

Step 7: Recognise an outgoing spam run

A spam run usually shows up as one sender, or one account, with a very large number of messages going to many unrelated domains. The exiqsumm -s output makes this obvious, because one sender dwarfs the rest.

This command counts how many queued messages come from one sender address, using a case-insensitive match on the sender.

exiqgrep -f user@example.com -c

You will see a single count. Compare it with what that customer normally sends.

Made-up example: you run exim -bpc and see 4,800, when a few minutes ago it was 300. The exiqsumm -s output shows nearly all of it from newsletter@example.com, going to thousands of addresses across hundreds of domains, and exim -Mvh on a sample shows a pharmacy subject line the customer would never send. That is almost certainly a compromised mailbox password or a hacked contact form.

Why this matters: while spam sits in your queue, the server keeps trying to deliver it, and receiving servers may start treating your server's IP address as a spam source. That hurts every other customer on the same server.

Step 8: Recognise a bounce flood

A bounce flood shows as many messages with <> as the sender. Run exim -bp | exiqsumm -b and see how large the bounce group is.

Bounces often follow spam in practice: when a spam run fails, the bounces pile up waiting to go back to fake or unreachable addresses.

Heads up: a pile of bounces is a symptom. Find and stop the source first, or the queue will refill as fast as you clear it.

Step 9: Remove what you have confirmed is junk

Only do this once you have saved the listing from Step 2 and checked samples with exim -Mvh. The cPanel documentation is clear that you cannot recover deleted emails.

This command removes a single message from the queue. Per the Exim specification, no bounce is sent and the message is simply forgotten.

exim -Mrm 1abcDE-0001xy-AB

You should see a line saying the message has been removed. If you see that the message is locked, the cPanel documentation explains that the system is in the process of sending it right now. Leave it alone and check again shortly.

For a bulk clean-up, narrow the match as far as the evidence allows. cPanel's support guidance recommends combining sender and recipient filters when possible. First preview the exact message IDs; this command does not delete anything.

exiqgrep -f '^user@example\.com$' -r '^recipient@example\.net$' -i

Open several returned IDs with exim -Mvh and confirm they belong to the same unwanted campaign. Then run the same exact filters through xargs -r; on GNU/Linux, -r prevents exim -Mrm from running when the filter returns no IDs.

exiqgrep -f '^user@example\.com$' -r '^recipient@example\.net$' -i | xargs -r exim -Mrm

You will see one "removed" line per message, plus a "locked" line for any message being sent at that moment.

Heads up: -f and -r take patterns. Anchor exact addresses with ^ and $, and escape dots as shown. If you only know the sender, preview the anchored sender-only IDs and inspect several headers before deleting; a sender-only sweep has a wider blast radius.

The cPanel documentation also gives exiqgrep -i | xargs exim -Mrm to delete the entire queue. That removes legitimate mail too, including invoices and password resets waiting for a slow receiving server. Treat it as a last resort, and never as a first fix.

Step 10: Retry a stuck message you want to keep

This command thaws a frozen message so Exim can resume delivery attempts.

exim -Mt 1abcDE-0001xy-AB

This command asks Exim to try delivering one message right now. If the message is frozen, Exim thaws it automatically first.

exim -M 1abcDE-0001xy-AB

Afterwards, run exim -Mvl on the same ID to see the new attempt.

Use the Mail Queue Manager in WHM

If you prefer clicking to typing, WHM has a screen for the same job. Your host can disable it for resellers, so if you are a reseller and cannot see it, ask them.

Step 1: Open the queue

Go to WHM > Email > Mail Queue Manager, which at the time of writing (15 November 2026) sits in the Email section of WHM. You can leave the search box empty, choose No Filter in Select Query, and click Run Report to see everything.

The table shows Time Received, Sender, Message ID, Recipient(s), Size, Status and Action by default.

Step 2: Filter for one sender or recipient

Type an address into the search box, choose which part of the message to search in Select Query, and pick a Search Type. The cPanel documentation notes that Partial runs slower than Begins With and Exact, and that the search does not look inside message bodies.

Step 3: Act on messages

The Action icon on each row opens details and offers Delete Message, Deliver Message Now and Return to Mail Queue. Below the table you will find Delete Selected, Deliver Selected, Delete All and Deliver All.

Heads up: the documentation warns that Delete All deletes all emails, both from the filtered list and the mail queue. Filtering first does not limit it. Use Delete Selected for targeted clean-ups.

Step 4: Unfreeze a message

Frozen messages show an unfreeze icon. According to the cPanel documentation, the system freezes a message after several failed delivery attempts and will not try again until you unfreeze it manually or the system reaches a timeout. You can unfreeze one message at a time.

If you find many frozen messages, the documentation points you to /var/log/exim_mainlog to find the cause, which is where exigrep helps.

Check delivery history in WHM

The queue only shows mail still waiting. For mail that has already succeeded, failed or been rejected, go to WHM > Email > Mail Delivery Reports.

Root users can search mail for every account on the server. Resellers see only accounts they own, if the host has enabled the screen for them.

Each row has an Event icon that shows whether the message was delivered, deferred, hit a delivery error, or was rejected, the last meaning the system refused the message at SMTP time. You also get a Spam Score column, and you can add columns such as Sender IP and Authentication, which help when you suspect a stolen password.

Quick tip: keep the date range short. The documentation warns that a large date range drastically increases query time on busy mail servers.

Track Delivery for cPanel account owners

Without root you cannot see the server queue, but you can still answer "did my mail go out?" for your own mailboxes.

Step 1: Open Track Delivery

Go to cPanel > Email > Track Delivery. At the time of writing (15 November 2026), the cPanel documentation says the table by default lists the 250 most recent messages sent to and from your account's mailboxes.

Step 2: Show only the problems

Click Show Blocked & Failed to see delivery failures only, or Show All to go back. The table options also have Show Successes, Show Deferred, Show Failures and Show In-Progress checkboxes.

A deferred message is one the receiving server has not accepted yet, so it is still being retried. That is usually where "slow email" lives.

Step 3: Read one message's story

Click the information icon in the Actions column to view and print the details for that message. Read the Result column and the details together, and send them to your host or the recipient's IT team, because that is exactly what they will ask for.

Why this matters: a failure caused by the recipient's server rejecting your domain often points to missing sender records. Our guide to SPF, DKIM and DMARC for small business email walks through fixing that.

How to check it worked

After any change, confirm the result rather than assuming it.

  • Run exim -bpc again. After removing a spam run, the count should be lower by roughly the number you removed, and it should stay down over the next few minutes.
  • Run exim -bp | exiqsumm -s. The sender you cleaned up should be gone or close to zero. If it climbs again, the source is still active.
  • Run exiqgrep -z -c. After unfreezing and retrying, the frozen count should drop or stay flat.
  • Run exim -Mvl on any message you retried. You should see a new attempt with either a delivery or a clear reason.
  • In WHM > Email > Mail Delivery Reports, search the recipient. A retried message that went through should show a delivered event.
  • As an account owner, send a test from webmail to an outside address you control, then check Track Delivery. It should appear as a success.

Troubleshooting

"Message 1abcDE-0001xy-AB is locked"

Likely cause: Exim is in the middle of delivering that message, which is what the cPanel documentation says this means. Fix: wait a minute and run exim -bp 1abcDE-0001xy-AB to see whether it is still queued before trying again.

The queue refills as fast as you clear it

Likely cause: the source is still active, usually a mailbox with a stolen password or a script on the account sending mail. Fix: identify the sender with exiqsumm -s, change that mailbox password, check the account's website for an abused contact form, and only then clear the queue again.

exim -bpc will not run for your user

Likely cause: you are not root. The Exim specification restricts queue listing and counting to admin users by default. Fix: switch to root, or ask your host to run the check for you.

Track Delivery shows no messages at all

Likely cause: the cPanel documentation says the table only shows messages stored in the eximstats database, and that an empty table means the provider has not enabled the feature in Service Manager. Fix: ask your host to enable it.

Many messages frozen to one domain

Likely cause: the receiving server keeps refusing or timing out, often because it has blocked your server's IP or the domain's mail records are wrong. Fix: read exim -Mvl on two or three samples and search /var/log/exim_mainlog with exigrep. The quoted reason tells you whether it is a block, a full mailbox or a DNS problem.

Pro tips and security notes

Quick tip: make exim -bpc the first thing you run on every "email is slow" ticket. A low, steady number rules out the server in seconds and sends you to look at the customer's mail client or the recipient's side.

Prefer exim -Mrm to exim -Mg for confirmed spam. The Exim specification says -Mg sends a delivery error message back to the sender for non-bounce messages, which with spam means sending more junk to forged addresses.

Treat message bodies as private, and share them only with the people handling the ticket.

When you find a spam run, the queue clean-up is the last step, not the first. Reset the mailbox password, tell the customer, and check their devices. Our guide to setting up business email in cPanel is a good refresher on configuring mail apps with fresh passwords.

Ask your host when you do not have root, when you suspect the server's IP address has been blocked, or when you are tempted to delete the whole queue. A second pair of eyes is cheaper than lost invoices.

The one message worth forwarding

Copy this, fill in the brackets, and send it to your host or developer.

Hi, we are seeing email delays on [server name or domain].

At [time and timezone], exim -bpc showed [number] messages, and [number] a few minutes later.
exim -bp | exiqsumm -s shows most of the queue from [sender address].
exiqgrep -z -c shows [number] frozen messages.
A sample message ID is [message ID], and exim -Mvl on it says: [paste the failure reason].

I have saved the queue listing and have not deleted anything yet.
Could you confirm whether this sender is compromised and whether the server IP is on any blocklist, and advise before I remove anything?

Thanks,
[your name]

Count first, read second, and delete only what you have looked at, because the queue forgives slowness but never forgives a hasty -Mrm.

Reader questions

How do I list only messages that have been waiting a long time?

Use exiqgrep with the -o option followed by a number of seconds, which matches messages older than that age. The -y option does the opposite and matches younger messages.

Can a reseller use Mail Queue Manager or Mail Delivery Reports?

Only if the hosting provider enables those interfaces for resellers. In Mail Delivery Reports, resellers see only mail for accounts they own, while root sees every account.

How long does Track Delivery keep its history?

The hosting provider decides. The retention interval for Exim stats is a WHM Tweak Settings value measured in days.

Can I see the whole server queue from a cPanel account?

No. Listing and counting the queue is restricted to admin users by default, so account owners use Track Delivery for their own mailboxes instead.

Does the Mail Queue Manager search look inside message bodies?

No. The cPanel documentation says its search does not check message bodies, so search by sender, recipient or other fields.

Why does a frozen message stay in the queue?

Exim suspends delivery attempts on a frozen message. In WHM it is not retried until you unfreeze it or the system reaches a timeout, and on the command line exim -M thaws it automatically before trying again.

Sources & further reading

  1. cPanel: How to manage your Exim queue
  2. Exim specification: The Exim command line
  3. Exim specification: Exim utilities
  4. cPanel: WHM Mail Queue Manager
  5. cPanel: WHM Mail Delivery Reports
  6. cPanel: Track Delivery

What changed

Safety review on 15 November 2026: replaced a broad sender-only bulk deletion example with a non-destructive ID preview, anchored sender-and-recipient filters, sample header checks, and xargs -r protection; refreshed dated references and added an original accessible cover.

Originally published . About our editorial updates.

Your next project deserves a better foundation.

Explore hosting built for your next chapter.

Explore hosting

Find your next answer.

Search published guides and articles.

Ctrl / ⌘ K to open · Esc to close