Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added senderscore.sh, a utility to log to CSV the SMTP sender scores …
…for blocks of IPs
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 | |||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 |