Looking at the mail logs on your server is very useful, if you are having trouble with getting or sending mail. The error log can tell you exactly what is going on, so that you an fix the issue. There are a number of errors that could happen, but those errors will not be covered in this article.

To run these commands, you need root level access to SSH, or to your terminal in WHM.

Watching the logs live is very useful as you can start this command, then it will watch the log live while you send a test message. Hold Ctrl-C to stop the log:

Watch the log in real time:

tail -f /var/log/exim_mainlog

Another useful way of checking the exim log, is to search for something specific. Usually an address, subject line, or time frame would be the best options

Search the log using grep: replace email@havingtrouble.com with your search term

grep "email@havingtrouble.com" /var/log/exim_mainlog

Other Useful commands

Count the messages in the mail queue:

exim -bpc

List all messages in the mail queue:

exim -bp

Look at the logs for a specific message ID that is in the queue – replace <MESSAGE ID> to your messages ID

exim -Mvl <MESSAGEID>

Look at the head for a specific message ID that is in the queue – replace <MESSAGE ID> to your messages ID

exim -Mvh <MESSAGEID>

Look at the body for a specific message ID that is in the queue – replace <MESSAGE ID> to your messages ID

exim -Mvb <MESSAGEID>

Force send a message in the mail queue: –  replace <MESSAGE ID> to your messages ID

exim -M <MESSAGEID>

Leave a Reply

Your email address will not be published. Required fields are marked *