Search


Thursday, August 11, 2011

Exim CheatSheet

Exim cheatsheet

 

Print a count of the messages in the queue

exim -bpc
Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient)

exim -bp
Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals)

exim -bp | exiqsumm
Remove all frozen messages in queue

exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm
Remove all mails that has a certains string in it

grep -lr 'search string' /var/spool/exim/input/ | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm

Remove mails with more than 10 recipients

exipick -i '$recipients_count > 10' |  xargs exim -Mrm
View a message's log


exim -Mvl <message-id>
Remove all mails in queue

exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
Remove all mails sent from nobody

for i in `exim -bpr | grep nobody | awk {'print $3'}`; do exim -Mrm $i; done
Get list of scripts which sends out mails

for i in `exim -bp | awk '{print $3}' | sort | uniq `; do exim -Mvh $i | grep "X-PHP-Script"; done | awk '{print $3}' | sort | uniq
Find the authenticated user involved in mails in queue

for i in `exim -bp | awk '{print $3}' | sort | uniq `; do exim -Mvh $i | grep "auth"; done
Check out more on
http://bradthemad.org/tech/notes/exim_cheatsheet.php

 

1 comment: