Delete Exim Mail Queue from the command line (WHM/cPanel)

Category : cPanel/WHM

Stuck with the long mail queue due to some spam and it’s taking forever to load in the WHM UI ?

Well, everyone have been there once.

There is a quick way to clear the mail queue from the command for WHM based servers only.

Login into your server via root and run the following command :

exiqgrep -o 360 -i | xargs exim -Mrm

This will remove mails older than 6 mins (360 seconds). adjust your time accordingly. Reason for putting the timer is that, by mistake the most recent emails which should be delivered while you doing the delete procedure are saved.