Difference between revisions of "Exim Queue Scripts"

From James Dooley's Wiki
Jump to: navigation, search
(Created page with "==Overview== Different scripts to search the exim queue. ==Script== Find top sending addresses for current messages in queue <code>[bash,n] find /var/spool/exim/input -name '*-H...")
 
(Script)
Line 15: Line 15:
 
Get list of IP addresses sending messages from specific address
 
Get list of IP addresses sending messages from specific address
 
<code>[bash,n]
 
<code>[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); do exim -Mvh $i | grep helo | cut -d "[" -f2 | cut -d "]" -f1| grep -v helo_name; done | sort | uniq -c | sort -n
+
for i in $(find -name '*-H' | xargs grep 'auth_id' | grep <EMAIL ADDRESS> | cut -d: -f1 | cut -d/ -f3 \
 +
| 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
 
</code>
 
</code>
  

Revision as of 15:57, 22 June 2011

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' | 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/ -f3 | cut -d- -f1-3

Get list of IP addresses sending messages from specific 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); 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); do exim -Mrm $i; done

What to change