Permalink
Browse files

Added senderscore.sh, a utility to log to CSV the SMTP sender scores …

…for blocks of IPs
  • Loading branch information...
1 parent 1d098af commit 49cf0aecf76ed58476f05d2ce53137186f339365 @derwiki committed May 11, 2011
Showing with 38 additions and 1 deletion.
  1. +2 −1 README
  2. +36 −0 senderscore.sh
View
3 README
@@ -1,4 +1,5 @@
Collection of scripts that I find enhance my Command Line Experience (r)
- json2csv.py: Extract keys from newline seperated JSON dictionaries to CSV output
+ json2csv.py: Extract keys from newline seperated JSON dictionaries to CSV output
+ senderscore.sh: Log to CSV the SMTP sender scores for blocks of IPs
View
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# senderscore.sh
+#
+# Log to CSV the SMTP sender scores for blocks of IPs
+# System requirements: `host` utility must be installed.
+#
+# based on information found on:
+# http://blog.highspeedweb.net/2010/08/31/monitor-your-ips-with-senderscore-automatically/
+
+### OVERRIDE THESE >>>>
+# First 3 octets of IP address, forward and reversed
+static="192.168.0."
+staticrev=".1.0.192"
+
+# build a hash table of (label, last IP octet)
+declare -A ipranges
+ipranges[transactional]="220"
+ipranges[bulk]="221 222 223 224 225 226 227"
+### OVERRIDE THESE <<<<
+
+zones="score cmplt.rating filtered.rating uus.rating vol.rating"
+
+for zone in $zones; do
+ for key in ${!ipranges[@]}; do
+ for iprange in ${ipranges[$key]}; do
+ for ip in $iprange; do
+ revip=${ip}${staticrev}
+ fullip=$static$ip
+ result=$(host ${revip}.${zone}.senderscore.com)
+ #
+ echo $zone,$key,$fullip,${result##*.}
+ done
+ done
+ done
+done

0 comments on commit 49cf0ae

Please sign in to comment.