Manually Clear from Console / Command Line cPanel Exim Mail Queue

Server Maintenance | Updated 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 "sender@domain.com"

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 "spammer@domain.com" | 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

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 March 2026 · Browse all Server Maintenance articles

  • 147 Users Found This Useful

Was this answer helpful?

Related Articles

Repairing and Optimizing all MySQL and MariaDB Databases on the Server

Server Maintenance | Updated 2026 Regularly repairing and optimizing MySQL/MariaDB tables...

Create CXS Quarantine Directory

Server Maintenance | Updated 2026 ConfigServer eXploit Scanner (CXS) quarantines suspicious...

E Sysup: Needed system RPMs were not installed: yum-utils

Server Maintenance | Updated 2026 The error E Sysup: Needed system RPMs were not installed:...

error: db3 error(-) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery

Server Maintenance | Updated 2026 The error db3 error(-30974) from dbenv->failchk:...

FSCK Options and Maintenance

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



Save 30% on web hosting - Use coupon code Hosting30