Eye to eye with Exim

Sometimes there are messages stuck in the Exim mail queue and sometimes you might wish to look inside them. Exim is a complex beast, but it comes with plenty of tools to help you analyze the current situation.

To see how many mails are stuck in the queue and since when use:

mailq

This will output a list of message IDs; to look inside these messages use for the header

exim4 -Mvc [message-ID]

for the body

exim4 -Mvb[message-ID]

If these don’t work for you, try “exim” or “exim3” instead of “exim4”.

Here are a few more commands (via Florian Fritsch):

Get the mail queue as a table:

mailq | exiqsumm

Get the number of mails in the queue:

exim4 -bpc

Force the delivery of emails that have a local recipient:

exim4 -ql

Find out why a specific mail could not be delivered:

exim4 -v -M [message ID]

Process the queue and send out the emails (if possible):

exim4 -q

Process the queue and send out the emails (verbose mode):

exim4 -qff -v

Send out frozen emails:

exim4 -Mt [message ID]

Delete all frozen emails:

mailq | awk '/frozen/{print "exim4 -Mrm "$3}' | /bin/sh

Delete a specific email from the queue:

exim4 -Mrm [message ID]