[Pymilter] Failed SPF checks for _spf.google.com
Stuart D Gathman
stuart at bmsi.com
Sat Nov 29 00:27:15 EST 2014
On Nov 26, Andre Esser transmitted in part:
> I'm seeing strange behaviour of the SPF module for Python. The issue
> is that an SPF lookup for _spf.google.com returns 'None':
>
> # python3 /usr/lib/python3/dist-packages/spf.py _spf.google.com
> None
>
> The equivalent query with dig on the same server however succeeds:
>
> # dig _spf.google.com txt +short
> "v=spf1 include:_netblocks.google.com include:_netblocks2.google.com \
> include:_netblocks3.google.com ~all"
Just back from Thanksgiving, but shooting from the hip - there is a
known bug (that I need to release the fix for) where some caching nameservers
case fold domains stored in their cache. This means that the initial
query may have a different case than subsequent queries. The internal
cache in pyspf needs to also case fold cache entries. Although I wonder
if this workaround fails when the caching server folds to upper case
instead of lower case.
I cannot be certain that is what is happening in your case, but that
kind of wierdness is typical of the presentation.
I have not released the fix because I *really* want to have a good way
of exercising it in the test suite. Which currently doesn't have a way
to return a sequence of results for a given query in the test DNS data.
More information about the Pymilter
mailing list