Sometimes it's easier and faster to manage your EXIM mail queue via SSH, rather than through WHM or cPanel.
This is especially true when resolving issues with an exceptionally large email queue.
Listed below are the most common commands for managing your EXIM email queue.
Check EXIM Queue Size:
Shellexim -bpc
View all emails in the EXIM Queue:
Shellexim -bp
View all emails in the queue FROM a specific email address:
Shellexiqgrep -f email@example.com
View all emails in the queue TO a specific address:
Shellexiqgrep -r email@example.com
View the MESSAGE_ID of all emails from a specific email address:
Shellexiqgrep -f email@example.com -i
Remove a single email from the EXIM Queue:
Shellexim -Mrm MESSAGE_ID
The message ID is a unique identifier, which looks like this example: 1ePN2j-000pzx-RB
Remove all emails from a certain email address from the queue:
Shellexiqgrep -f email@example.com -i|xargs exim -Mrm
Clear all 'Frozen' (undeliverable) emails from the queue:
Shellexiqgrep -zi|xargs exim -Mrm
Clear ALL emails from the Queue (Unsent emails will be lost forever - Be Careful!)
Shellexiqgrep -i|xargs exim -Mrm