Very frustrating. So you find out one of your WordPress sites was exploited and sent out thousands of emails from your VPS or server. You found the account or plugin/theme that did it, fixed it, and the bleeding has stopped.
But now, your email queue from within WHM won’t even load because of the thousands of emails in there. Using the conventional WHM email queue to clear the emails isn’t working. If this is the case and you want to delete all of your emails, there are multiple techniques to do this.
METHOD #1
1) Login to SSH as the root user of your VPS hosting account.
2) Run the following:
exiqgrep -i | xargs exim -Mrm
This may take a while depending on the amount of emails you have. Once it’s done, you’re good to go.
METHOD #2: The most radical technique that works with email queues that just have wayyy too many emails in them and method #1 just isn’t cutting it. Do the following:
1) Login to SSH
2) Run the following:
cd /var/spool/exim
find input -type f -exec rm -rf {} \;
find msglog -type f -exec rm -rf {} \;
service exim restart
That’s it. Now log back into WHM and your email queue should be empty and load with no problems.