Skip to content

Commit

Permalink
Added senderscore.sh, a utility to log to CSV the SMTP sender scores …
Browse files Browse the repository at this point in the history
…for blocks of IPs
  • Loading branch information
derwiki committed May 11, 2011
1 parent 1d098af commit 49cf0ae
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README
@@ -1,4 +1,5 @@
Collection of scripts that I find enhance my Command Line Experience (r) 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


36 changes: 36 additions & 0 deletions senderscore.sh
@@ -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.