Monday, November 1, 2010

Exim Commands

view all mails in queue

exim -bp

view the total count of the queue

exim -bpc

remove all mails in queue
exim -bp | exiqgrep -i | xargs exim -Mrm

exim -Mvh <msg id> - read the headers of the mail

exim -Mvb <msg id> - read the message body

exim -Mvl <message-id> - logs


remove frozen mails:


exim -bp | grep frozen | awk {'print $3'} | xargs exim -Mrm

or

exiqgrep -z -i | xargs exim -Mrm


freeze all the mails from a specified sender

exiqgrep -i -f luser@domain.com | xargs exim -Mf

Add the below two lines under check_recipient in the exim.conf to drop sender or from host

check_recipient:
drop_sender = /etc/exim_reject_senders
drop_hosts = /etc/exim_reject_hosts


add the specified domain name or hosts in the corresponding file. one entry per line.
 
exiqgrep -o 604800
Line mismatch: 170d 1IGLxw-0004Tw-Ne

# exim -bpru | grep “170d” | awk ‘{print $2}’
1IGLxw-0004Tw-Ne
1IGTFn-0000VM-UI
#exim -bpru | grep “170d” | awk ‘{print $2}’ | xargs -n 1 -P 20 exim -Mrm