Exim
Revision as of 19:01, 19 November 2018 by Ekaanbj (talk | contribs) (→Stolen with pride from http://forum.likg.org.ua/server-side-actions/basical-exim-mta-commands-t23.html)
copy all mails
Make a file called exim.filter in the /etc/exim directory with the following line: unseen deliver <email adress of the admin> and in the main part of the exim.conf system_filter = /etc/exim/exim.filter system_filter_user = exim THE file /etc/exim/exim.filter has to be owned by exim. ALL email that comes in and out comes with a copy to the admin.
To print a list of the messages in the queue, enter:
exim -bp
To remove a message from the queue, enter:
exim -Mrm {message-id}
To remove all messages from the queue, enter:
exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
Remove frozen mails
exim -bp|grep frozen|awk '{print $3}' |xargs exim -Mrm
Stolen with pride from http://forum.likg.org.ua/server-side-actions/basical-exim-mta-commands-t23.html
flush exim queue
exim -qff
Flush mail queue in a verbose mode.
sudo exim -d -qff -v 2>&1 | less -ISRM
Force delivery of one message
exim -M email-id
Force another queue run
exim -qf
Force another queue run and attempt to flush the frozen message
exim -qff
View the log for the message
exim -Mvl messageID
View the body of the message
exim -Mvb messageID
View the header of the message
exim -Mvh messageID
Remove message without sending any error message
exim -Mrm messageID exim -Mg messageID => Giveup and fail message to bounce the message to the Sender exim -bpr | grep "<" | wc -l => How many mails on the Queue exim -bpr | grep frozen | wc -l => How many Frozen mails on the queue exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm => Deleteing Frozen Messages exim -bpc => find out, how many mails are there in the mail queue exim -bp => check the mails in the queue <== exiqgrep -- works faster exim -bt email => trace message delivery exim -bp| exiqsumm => summary of the email queue exim -brt halfface.se # Retry rule for instance.
Exim stats
eximstats /var/log/exim/main.log
exiwhat
What are exim services doing.
remove mails from regex
exiqgrep -i -r reciever@somewhere.com | xargs exim -Mrm
count mails in queu
exim -bpc
View message header
exim -Mvh <message-id>
View message body
exim -Mvb <message-id>
View message logs
exim -Mvl <message-id>