How to clear Exim queue using ssh
Sometimes if an account on your server is compromised. The Exim mail queue will quickly fill up with thousands of spam emails and clear Exim queue. 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 queue.
The Exim queue can be cleared in a number of ways. If there are thousands of emails waiting to be processed in the queue the best way is by using ssh.
Left, the emails will keep building up in the queue and eventually, the server will stop working. After the queue is clear you should secure the server or any account that has been compromised.
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 clear the queue. If you don’t the mail queue will just fill up again.
Get free cPanel server management with each cPanel VPS Server.
How was this article? Clear Exim Queue
You might also like
More from cPanel
How To Install A Cloudflare Origin SSL Certificate In cPanel
Free SSL Certificates from places like cPanel or Let's Encrypt are great. When Let's Encrypt first introduces free SSL Certificates …
Create a SWAP partition on CentOS, RHEL and AlmaLinux without a reboot
SWAP is a memory type that Linux NVMe VPS Servers use to process requests. Memory will be held in SWAP …
Help fixing Error: last request failed: [AUTH] Authentication failed.
The Error: last request failed: [AUTH] Authentication failed error can be caused by a range of things. It could be …