cPanel & WHMEmail

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 cPanel Exim from SSH. On cPanel Servers where you or your customers have old versions of content management systems like WordPress, it’s 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 server’s 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.

cPanel Exim Cheat Sheet Linux

These command commands to manage Exim from SSH on Linux NVMe VPS Servers.

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 By SSH

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

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button