Re: Harvest netblocks of good MTAs from SPF for whitelisting from greylisting

Stuart D Gathman <[email protected]> Tue, 12 Feb 2013 22:59:45 -0500 (EST)
Newsgroups gmane.mail.spam.spf.discuss
Message-ID <[email protected]>
On Feb 12, Constantine A. Murenin transmitted in part:

>> same colocation facility might have both "good" and "evil" domains.  The
>> idea of statically compiling the IP set for your type of application is a
>> good one, and has already been implemented.
>
> Where has it been implemented?  Please provide me a link, I'm very
> interested in applying it to my setup.

I did a quick and dirty for pyspf (just add ips to a set while evaluating):

http://spidey2.bmsi.com/pyspf/spf.py

$ python spf.py 0.0.0.0 [email protected] google.com
(('softfail', 250, 'domain owner discourages use of this host'), '~all')
216.239.32.0/19
64.233.160.0/19
66.249.80.0/20
72.14.192.0/18
209.85.128.0/17
66.102.0.0/20
74.125.0.0/16
64.18.0.0/20
207.126.144.0/20
173.194.0.0/16
216.73.93.70/31
216.73.93.72/31

This needs to ensure that all paths are followed, and combine adjacent
blocks (e.g. the last two above).  It also needs to handle IP6.