List of Useful Exim Commands

Created June 29, 2020


Exim is one of the most popular message transfer agent (MTA). It is widely used on different systems and is the goto message transfer agent for most cPanel servers.

Exim was developed at the University of Cambridge for use on Unix systems.

It is an open-source project with the terms of the GNU General Public Licence.

Exim is a very powerful and flexible MTA and is often installed in place of Sendmail, although the configuration of Exim is quite different.

Useful Exim Commands

If you are using Exim with your cPanel servers, you can do a lot of the tings through your WHM interface, however here's how you could manage exim via your terminal as well.

exim -bpc
exim -bp
exim -bp | exiqsumm
exiqgrep -i -f | xargs exim -Mrm
exiqgrep -ir | xargs exim -Mrm
exim -bpr | grep "<" | awk {'print $4'} | cut -d "<" -f 2 | cut -d ">" -f 1 | sort -n | uniq -c | sort -n
grep "cwd=/home" /var/log/exim_mainlog | grep -v Cron | awk '{for(i=1;i<=10;i++){print $i}}' | sort | uniq -c | grep cwd | sort -n
awk '{ if ($0 ~ "cwd" && $0 ~ "home") {print $3} }' /var/log/exim_mainlog | sort | uniq -c | sort -nk 1
grep 'cwd=/home' /var/log/exim_mainlog | awk '{print $3}' | cut -d / -f 3 | sort -bg | uniq -c | sort -bg
egrep -R "X-PHP-Script"  /var/spool/exim/input/*
eximstats -ne -nr /var/log/exim_mainlog
netstat -plan | grep :25 | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1
ps -C exim -fH ewww | awk '{for(i=1;i<=40;i++){print $i}}' | sort | uniq -c | grep PWD | sort -n
exim -bpr | exiqsumm -c | head
exim -Mvh messageid
exim -Mvb message id 


This is my personal Exim commands cheatsheet. I use these commands a lot when troubleshooting various problems with my mail servers.

I hope that you find this helpful!