-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsenderscore.sh
executable file
·36 lines (31 loc) · 952 Bytes
/
senderscore.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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