akpoff / spf_fetch

Collection of utilities to recursively look-up SPF records and manage whitelists
ISC License
31 stars 3 forks source link

Errors #5

Open Mrothyr opened 4 years ago

Mrothyr commented 4 years ago

Hi,

thanks for the script.

In regular use it produces fragmentary IP adresses. For example mail.ru:

_spf.mail.ru:

"v=spf1 ip4:94.100.176.0/20 ip4:217.69.128.0/20 i" "p4:128.140.168.0/21 ip4:188.93.58.0/24 ip4:195.2" "11.128.0/22 ip4:188.93.59.0/24 ip4:128.140.170.0" "/24 ip4:178.22.92.0/23 ip4:185.5.136.0/22 ip4:5." "61.237.0/26 ip4:5.61.237.128/25 ip4:5.61.236.0/2" "4 ip4:5.61.239.143/32 ip4:5.61.239.144/32 ip4:95" ".163.216.38/31 ~all"

In common_domain_ips then sometimes IPs fragmentet by the '" "' in the dig response.

IPs for _spf.mail.ru...

94.100.176.0/20 217.69.128.0/20 188.93.58.0/24 195.2 188.93.59.0/24 128.140.170.0 178.22.92.0/23 185.5.136.0/22 5. 5.61.237.128/25 5.61.236.0/2 5.61.239.143/32 5.61.239.144/32 95.163.216.38/31

So I look in spf_fetch. In line 103 you delete the quotation marks, but the space between remains. I patched it with

| sed 's/" "//g' \

as new line 103 to delete this complete. And then delete the remaining quotation marks.