Stuart D. Gathman wrote:
On Wed, 16 Mar 2005, Radu Hociung wrote:
Do you know of other available optimizers ?
Not any general purpose ones, like you're building. Rigging the Python spf
module to build an ip list while evaluating an SPF record was fairly trivial,
however (and suited my purposes). Preserving the policy for each part of the
list will be a little harder. I am thinking of making this part of the API.
Another option would be to simplify to A and IP4 mechanisms.
It's pretty easy to come up with an ordered list of ip4 mechanisms with
the correct prefixes. My compiler does this already also.
The challenges I have found so far are:
1. folding the long resulting record into multiple smaller records
(<512-bytes - UDP limit)
2. compacting lists of IPs into IP blocks. This requires re-ordering
of the ip mechanisms. The challenge is to reorder ip addresses with
different prefixes, ie:
* "-ip4:1.2.3.100/2 +ip4:1.2.3.0/24" cannot be compacted
* "+ip4:1.2.3.0/24 -ip4:1.2.3.100/2" can be compacted to
"+ip4:1.2.3.0/24"
* "+ip4:1.2.3.0/24 +ptr -ip4:1.2.3.100/2" cannot be compacted
3. directives (exp=, etc). Where to put them when includes and
redirects are involved?
Perhaps I could postpone the implementation of the more complicated
cases like 3.
In anycase, where corner-cases are not handled, the output of the
compiler must be functionally equivalent to the input, but perhaps
less efficient than it is possible. Otherwise, it's a broken compiler
that does more harm than good.
We should start a new thread on optimizations if you'd like to discuss it.
Thanks,
Radu.
-------
Sender Policy Framework: http://spf.pobox.com/
Archives at http://archives.listbox.com/spf-discuss/current/
Read the whitepaper! http://spf.pobox.com/whitepaper.pdf
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-discuss(_at_)v2(_dot_)listbox(_dot_)com
radu.vcf
Description: Vcard