Hello, I will show basic commands for working with exim in console 🙂
Log file is located in /var/log/exim_mainlog
Email information when sending and receiving :
Real time tracking entries exim_mainlog:
Look at the last 500 entries in exim_mainlog:
tail -500 /var/log/exim_mainlog
To delete messages in queue older than 5 days (sometimes stand there and do not want to go). The figure comes from (86,400 seconds is one day * 5 days = 432,000 seconds):
exiqgrep -o 432000 -i | xargs exim -Mrm
To view the headers of the message, sometimes it is useful if you need more information about any sent, received or not sent, not received message:
To view the contents of the letter:
To view the logs for the letter:
Everyone goes to delete mails in the queue that have the following string in your content: STRING:
grep -lr 'STRING' /var/spool/exim/input/ | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
To delete many emails sent from: firstname.lastname@example.org. Working with logs (exim_mainlog for received and sent >> / var / log / maillog for me and Razlog pop3, imap):
xiqgrep -i -f '' | xargs exim -Mrm
To check for sending a letter from a certain IP:
exigrep '<= .* \[127.0.0.1\] ' /var/log/exim_mainlog
To check for mails sent to a specific IP address:
exigrep '=> .* \[127.0.0.1\]' /path/to/exim_log
How to see all the emails that were returned in response to already sent mail:
exigrep '=> .*email@example.com' /var/log/exim_mainlog | fgrep '<='
To see the letters sent and received by firstname.lastname@example.org:
tail -5000 /var/log/exim_mainlog| grep "email@example.com"
To see the letters sent by firstname.lastname@example.org:
tail -5000 /var/log/exim_mainlog| grep "email@example.com" | grep "<="
To see the letters received from firstname.lastname@example.org:
tail -5000 /var/log/exim_mainlog| grep "email@example.com" | grep "=>"
You can check how a message is delivered:
exim -bt firstname.lastname@example.org
for more information : exim