Exim Queue Scripts
From James Dooley's Wiki
Contents
Overview
Different scripts to search the exim queue.
Script
Find top sending addresses for current messages in queue
[bash,n]
find /var/spool/exim/input -name '*-H' | xargs grep 'auth_id' | cut -d " " -f2 | sort | uniq -c | sort -rn
Get message IDs for messages from a specific sender
[bash,n]
find /var/spool/exim/input -name '*-H' | xargs grep 'auth_id' | grep <EMAIL ADDRESS> | cut -d: -f1 | cut -d/ -f7 | cut -d- -f1-3
Get list of IP addresses sending messages from specific address
[bash,n]
for i in $(find /var/spool/exim/input -name '*-H' | xargs grep 'auth_id' | grep info@emericapitol.com | cut -d: -f1 | cut -d/ -f7 \
| cut -d- -f1-3); do exim -Mvh $i | grep helo | cut -d "[" -f2 | cut -d "]" -f1| grep -v helo_name; done | sort | uniq -c | sort -n
Delete messages based on address
[bash,n]
for i in $(find -name '*-H' | xargs grep 'auth_id' | grep <EMAIL ADDRESS> | cut -d: -f1 | cut -d/ -f3 | cut -d- -f1-3 | xargs exim -Mrm