The Exim cheat sheet, common commands to manage Exim
Exim is the default email program for all cPanel VPS servers and cPanel dedicated servers. Our Exim cheat sheet will help you manage Exim. cPanel servers where you or your customers have old versions of content management systems like WordPress its possible people can take advantage of these old versions and in turn gain access to your account. Usually, we find accounts are compromised by outdated plugins and themes. Once compromised sites will send mass amounts of spam from your account resulting in the affected account being restricted.
These mass emails cause a huge issue with Exim and the servers load. As the queue gets longer it takes longer to process the emails after a few days the email queue can be tens of thousands of emails long. To manage the queue you can use our Exim cheat sheet.
Common Exim commands
See how many messages are in the Exim queue
exim -bpc
Get a list of the messages in the queue (time queued, size, message-id, sender, recipient)
exim -bp
Monitor what Exim is doing at the moment
exiwhat
Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals)
exim -bp | exiqsumm
Run a test SMTP session to see how a message would be delivered from the given ip address. The message is not actually sent
exim -bh 192.168.0.2
Display all of Exim’s configuration settings
exim -bP
Searching the queue using exiqgrep
Search for a sender by email address
exiqgrep -f
Search for a recipient by email address
exiqgrep -r [luser]@domain
Display messages older than a number of seconds (1 day in our example)
exiqgrep -o 86400
Managing the Exim queue
Process the email queue
exim -q -v
Deliver only local emails
exim -ql -v
Remove a message from the queue using the message id
-Mrm <message-id> [ <message-id> ... ]
Freeze a message in the queue
exim -Mf <message-id> [ <message-id> ... ]
Force delivery of a message
exim -M <message-id> [ <message-id> ... ]
Delete all messages in the queue
exim -bp | grep \< | awk '{print $3}' | xargs exim -Mrm
How was this article? Exim cheat sheet
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 …