Comments (2)
"Validating" is kind of a hack. You pass an ip that doesn't match anything, making everything get parsed. I'm not sure what Kitterman does, but you can pass the undocumented (should document) special value 'list' or 'list6' for the ip. This will not match any mechanism, and in addition tries to build a set of ips that would match and get Pass. This is very incomplete, and impossible in general. But it does make every mechanism get parsed, which "validates" the policy.
It SHOULD be possible to know when the list of matching ips is complete. The libspf C library does this, and can "compile" policies for ultra fast subsequent evaluations. It caches the ipset for any policy that can be completely represented by a set. E.g. "v=spf1 a:1.2.3.0/24 -all" Also, there should be an ipset for each result, not just Pass.
from pyspf.
It would be less hacky to just have a "validate" method that parses all mechanisms without otherwise evaluating them.
from pyspf.
Related Issues (20)
- NameError: name "strict" is not defined HOT 5
- Add special case for +all SPF ? HOT 17
- RST vs MD HOT 5
- http://openspf.net -> http://www.open-spf.org/ HOT 6
- dnspython and CNAME answers HOT 7
- Provide detailed explanation for SPF result, for "Received-SPF" header HOT 2
- Getting list of ip networks fails if prefix is 32 or more HOT 13
- Version number/branches for python3/ipaddress only releases HOT 2
- Using dnspython breaks relative lookups with search path HOT 1
- split() requires a non-empty pattern match HOT 17
- Allow custom DNS server HOT 4
- dnspython vs python3 dns dns.resolver.resolve lifetime arg bug HOT 1
- SPF with redirect problem HOT 1
- Passing lowercase qtype to DNSLookup_dnspython() always results in empty list HOT 3
- Example app illustrating legit use of +all
- Detect a non-trivial subset of AlwaysPass policies HOT 1
- PEP8 coding style HOT 2
- IndexError caused by malformed DNS packet
- Problems with ipv6 queries and void lookups HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyspf.