How to clean out a cpanel servers’s mail queue by command line

First stop exim in your WHM under services, just unclick any exim services running and save it.

Then open you ssh client and use this code:

/usr/sbin/exiqgrep -i | xargs /usr/sbin/exim -Mrm

Then restart exim.

This is much better then the mail queue system cpanel has installed, about 4 years (2009) they changed it and it’s just horrible now.

But thanks to the nice little code you can do it much faster from ssh.