cPanel & WHMEmail

How to clear the cPanel Exim queue using SSH

Sometimes if an account on your cPanel VPS Server is compromised. The Exim mail queue will quickly fill up with thousands of spam emails. If left, the Exim queue will start to slow the server down. Eventually, the server will fall over due to the huge processing power required to service the Exim queue. To prevent this you will need to clear the cPanel Exim queue by SSH.

The Exim queue can be cleared in several ways. If there are thousands of emails waiting to be processed in the queue, the best way is by using SSH. After the queue is clear you should secure the server or any account that has been compromised.

Clear cPanel Exim Queue By SSH

As the root user or a user with root privileges login to your server and issue the below command;

exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash

You should follow our guide on Compromised accounts to find out which account is sending the spam emails and suspend it as soon as you have run the above command to delete the cPanel Exim queue using SSH. If you don’t the mail queue will just fill up again.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button