# /var/log/exim_paniclog : info abt the exim program itself.

# /var/log/exim_mainlog : logs every single mail transaction.

# /var/log/exim_rejectlog : This logs delivery rejections.

# exim -bp : shows mails on the queue

# exim -bpc :This option counts the number of messages on the queue.

# exim -bpr :This option operates like -bp, but the output is not sorted into chronological order of message arrival.

# exiwhat : shows what exim is doing at the moment

# exim -bt [user]@domain : Test how Exim’s configuration will handle mail sent to the specified address.

# exiqgrep -f [user]@domain : Find messages from a particular sender in the queue.

# exiqgrep -r [user]@domain : Find messages to a particular addressee on your server.

# exim -Mrm <message-id> [ <message-id> ... ] : Remove a specific message(s) from the queue

# exiqgrep -o 36000 -i | xargs exim -Mrm : Remove all messages older than ten hours (36000 seconds)

# exim -Mvh <message-id> : View a specific message’s full headers.

# exim -Mvb <message-id> View a specific message’s body.

exim -bp | grep frozen | wc -l : Print number of frozen mails.

exiqgrep -z -i | xargs exim -Mrm : Delete frozen mails.

exim -bp | exiqgrep -i | xargs exim -Mrm : Remove all mails.

 

Some other useful commands :

– To list the folders from which mails can be generated :

awk '{ if ($0 ~ "cwd" && $0 ~ "home") {print $3} }' /var/log/exim_mainlog | sort | uniq -c | sort -nk 1

– To list which mail account is reporting highest activity :

exim  -bpr | grep "<*@*>" | awk '{print $4}'|grep -v "<>" | sort | uniq -c | sort -n