Server Maintenance

Manually Clear from Console / Command Line cPanel Exim Mail Queue

Updated November 2026 10,092 views 2 min read
Server Maintenance | Updated November 2026

If the Exim mail queue on a cPanel server is backed up with stuck or spam messages, you can clear it from the command line. This guide is for server administrators with root access.

Server Admin Only

These commands require root SSH access

Shared hosting customers cannot clear the mail queue directly. If you believe emails are stuck in the queue on your account, open a support ticket and we will investigate.

01. View the Queue

# Count messages in queue
exim -bpc

# List all messages with sender, time, and size
exim -bp | head -50

# Find messages from a specific sender
exim -bp | grep "[email protected]"

02. Clear the Queue

# Delete ALL messages in the queue (nuclear option)
exim -bp | awk '/^ *[0-9]/{print $3}' | xargs exim -Mrm

# Delete frozen messages only
exim -bp | grep "frozen" | awk '{print $3}' | xargs exim -Mrm

# Delete messages from a specific sender
exim -bp | grep "[email protected]" | awk '{print $3}' | xargs exim -Mrm

# Delete messages older than 24 hours
exiqgrep -o 86400 -i | xargs exim -Mrm

03. Force Delivery

# Force delivery attempt on all queued messages
exim -qff

# Force delivery of a specific message
exim -M <message-id>
Important

Before clearing the entire queue, check what is in it. A large queue often indicates a compromised account sending spam. Identify and fix the source before clearing, or the queue will fill right back up. Check exim -bp | awk '{print $4}' | sort | uniq -c | sort -rn | head -20 to find the top senders.

Shared Hosting Customer?

If your emails are delayed or not sending, open a ticket and we will check the queue for you.

Open a Support Ticket

Frequently Asked Questions

How do I view the Exim mail queue?

As root run exim -bp to list queued messages, or exim -bpc to show just the count. This reveals stuck or backlogged mail. It applies to VPS and dedicated servers with root; shared customers do not manage the Exim queue.

How do I clear the Exim mail queue?

As root, exiqgrep lets you target spam by sender before removing it, or you can remove messages by ID with exim -Mrm. Clearing the entire queue also deletes legitimate mail, so target spam where possible rather than wiping everything.

How do I force delivery of the queued mail?

Run exim -qff as root to force a delivery attempt on the whole queue, including frozen messages. This flushes legitimate mail that was merely delayed instead of deleting it, so try it before any mass removal.

Do shared hosting customers manage the Exim queue?

No. The mail queue is server-level and managed by us on shared hosting. This guide is for VPS and dedicated administrators with root. If outbound mail seems stuck on a shared account, open a ticket.

Quick Recap

  1. View queue: exim -bp
  2. Count messages: exim -bpc
  3. Delete frozen: Filter by "frozen" and pipe to exim -Mrm
  4. Find the source before clearing - Check top senders
  5. Shared hosting users: Open a ticket instead

Server administration · Last updated November 2026 · Browse all Server Maintenance articles

Share: X in Reddit f Email
  • 147 Users Found This Useful

Was this answer helpful?

Related Articles

Remount /tmp with exec permission

Server Maintenance | Updated November 2026 Some software installations and compilation tasks...

Clear cPanel Eximstats DB and Repairing the Eximstats DB

Server Maintenance | Updated January 2026 The Eximstats database in cPanel tracks email...

FSCK Options and Maintenance

Server Maintenance | Updated January 2026 fsck (file system check) scans and repairs Linux...

Error: rpmdb Open Failed with cPanel

Server Maintenance | Updated March 2026 The "rpmdb open failed" error means the RPM database...

How to Lock Down Your VPS or Dedicated Server Behind Cloudflare

Server Maintenance | Updated October 2026 Cloudflare can only filter the traffic that...



Save 30% on web hosting - Use coupon code Hosting30