On Friday I was greeted with a nice note from my hosting provider that “my CPU utilization had exceed 80% for six hours (a two days).” That was a head-scratcher since nothing is (normally) running on the server to drive up the CPU. After some quick digging what I discovered was akin to a cholesterol-clogged artery of spam.
I know enough Linux to get around and it wasn’t hard to see what process was hogging the CPU: exim. The exim service handles e-mail (SMTP) delivery and my server was busy handling outgoing messages. So busy in fact that no other services except ssh and WebHostManager were accessible.
In WHM’s left menu, under Email, is an option called Mail Queue Manager. It dutifully said there were over 1,000 messages and “did I want to list them all?” Hell no (!) so I clicked “delete all messages” and waited.
FireFox ground to a halt waiting for WHM to feed it an insanely large HTML file as it nuked the messages. Clearly upset at this proposition, Windows XP began to regurgitate memory to disk and the amber drive activity light went solid. A few “End Task” times later Windows came to its senses and I discovered there were over 40,000 messages in the queue. All spam.
I needed a quick and dirty solution to clear out the exim queue without bringing my web browser to its knees. The solution worked perfectly but I can’t vouch for any ill side-effects and none thus far.
Using ssh login as root. Navigate to the
/var/spool/exim/ folder and type
rm -Rf input. Press [Enter] and wait while Linux removes the contents of the folder. It may take a couple of minutes but substantially less than waiting for WebHostManager to do its work. When you’re dropped back to the shell prompt reboot the server for good measure and resume operations.
While I was in WHM I took the liberty to enable a feature in Tweak Settings to “Prevent the user ‘nobody’ from sending out mail to remote addresses.” Be sure the latter doesn’t break any of your server-side code for sending e-mail such as web site contact forms.