Mail Servers

Useful Exim Commands

exim commands
exim commands

Useful Exim commands

This post lists some useful Exim commands which will help you to troubleshoot Exim email issues. Please check the Exim commands below.

To get the count of the messages in the queue:

 
exim -bpc

To list the messages in the queue (time queued, size, message-id, sender, recipient):

 
exim -bp

To print summery of emails in the queue (count, volume, oldest, newest, domain, and totals):

 
exim -bp | exiqsumm

To delete an email in the queue:

 
exim -Mrm <Mail_ID>

Print the message-ids of the entire queue:

 
exiqgrep -i

To remove all emails in the queue:

 
exiqgrep -i | xargs exim -Mrm

To remove frozen emails in the queue:

 
exiqgrep -z -i | xargs exim -Mrm

To get current Exim status:

 
exiwhat

To Freeze a message:

 
exim -Mf

Freeze all queued mail from a given sender:

 
exiqgrep -i -f xyz@domain.com | xargs exim -Mf

To View email headers:

 
exim -Mvh <Mail_ID>

To View email body:

 
exim -Mvb <Mail_ID>

To View email log:

 
exim -Mvl <Mail_ID>

To Test how exim will route a given address:

  
exim -bt xyz@domain.com

To show default postfix values:

 
exim -bP

To get the email sending directory:

 
grep "cwd=" /var/log/exim_mainlog|awk '{for(i=1;i<=10;i++){print $i}}'|sort|uniq -c|grep cwd|sort -n

Force delivery of one message:

 
exim -M <Mail_ID>

Force another queue run:

 
exim -qf

Force another queue run and attempt to flush the frozen message:

 
exim -qff

To print messages younger than the specified number of seconds:

 
exiqgrep -y 3600

To print messages older than the specified number of seconds:

 
exiqgrep -o 86400

To delete all messages older than a day:

 
exiqgrep -i -o 86400 | xargs exim -Mrm

To delete frozen messages older than a day:

 
exiqgrep -zi -o 86400 | xargs exim -Mrm

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Topics