Exim

From Halfface
Jump to navigation Jump to search

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

exim -qff => flush exim queue

Flush mail queue in a verbose mode.

sudo exim -d -qff -v 2>&1 | less -ISRM
exim -M email-id => Force delivery of one message
exim -qf => Force another queue run
exim -qff => Force another queue run and attempt to flush the frozen message
exim -Mvl messageID => View the log for the message
exim -Mvb messageID => View the body of the message
exim -Mvh messageID => View the header of the message
exim -Mrm messageID => Remove message without sending any error message
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 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