PDA

View Full Version : Handy exim mailqueue commands, examples



Fli
08-26-2014, 05:32 PM
Please share veriffied exim commands which helps to manage exim mail queue

show exim statistics

eximstats -ne -nr -nt /var/log/exim_mainlog


show mail queue

exim -bp


show exim folders/queue data usage:

du -h /var/spool/exim --max-depth=1


flush mail queue

exim -qff


show mail body

exim -Mvb MessageID


show mail headers

exim -Mvh MessageID


Delete all "Frozen" mails in queue
1)
exiqgrep -zi | xargs exim -Mrm
2)
/usr/sbin/exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm


Delete failed delivery messages to (likely) non-existent senders:

exiqgrep -i -f '<>' | xargs exim -Mrm


Find & delete messages where recipient contains

exiqgrep -r [email protected] | awk {'print $3'} | xargs exim -Mrm


Find & delete messages where sender contains

exiqgrep -f [email protected] | awk {'print $3'} | xargs exim -Mrm


Find & delete messages of speciffied email user:

grep -lr '[email protected]' /var/spool/exim/input/ | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm
exim -bp | grep "user_email-account" | awk '{print $3}' | xargs exim -Mrm


Show folders which sent most emails in last hours

grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n


may list all system mail? then we can delete ( | xargs exim -Mrm )

exiqgrep -i -f '<System>'