Manually Clear from Console / Command Line cPanel Exim Mail Queue

Clearing the Exim Mail Queue From Command Line

 

If the Exim mail queue on your server has accumulated a large number of messages (often from spam or a compromised account), these commands will help you manage it. Root SSH access is required.

 

View Queue Size

exim -bpc

 

View Queue Contents

exim -bp | head -50

 

Delete All Frozen Messages

exiqgrep -z -i | xargs exim -Mrm

 

Delete All Messages in Queue

exiqgrep -i | xargs exim -Mrm

 

Delete Messages From a Specific Sender

exiqgrep -f spammer@domain.com -i | xargs exim -Mrm

 

Important: Before clearing the queue, investigate why it filled up. Check for compromised email accounts (change passwords), hacked PHP scripts (run a malware scan), or misconfigured forms sending to invalid addresses. Clearing the queue without fixing the root cause means it will fill up again.

 

This is a server administrator task. Shared hosting customers should contact support if they suspect mail queue issues.

  • 147 Users Found This Useful

Was this answer helpful?

Related Articles

cPanel Max Defers Occurring for an Account

While viewing exim_mainlog and seeing the following:   enforce_mail_permissions: Domain...

Recursive chmod / Permission Change Across Directories for a File Type

Recursive Permission Changes Across Directories   To change permissions recursively across...

SpamAssassin Command Line Bayesian Learn Command cPanel

Once it is enabled, it is necessary to train spamassassin to learn what is junk mail and what is...

ModSecurity: collection_store: Failed to access DBM file /var/cpanel/secdatadir/ip: Permission denied

The error Failed to access DBM file /var/cpanel/secdatadir/ip: Permission denied can occur on...

Repairing and Optimizing all MySQL and MariaDB Databases on the Server

From time to time you will find repairing and optimizing your databases are necessary. From a...



Save 30% on web hosting - Use coupon code Hosting30