spf-discuss
[Top] [All Lists]

Re: XML Schema for SPF records

2004-03-25 06:53:07
In 
<5D2A48CAB588334D988A9407DDE02F09031FB315(_at_)mailserver(_dot_)gfimalta(_dot_)com>
 "James Pullicino" <jamesp(_at_)gfi(_dot_)com> writes:

Is there an XML Schema for SPF records? Are there any plans to make
one? It would be useful in some situations for clients to convert
SPF records (after retreiving them from DNS) into XML and then
process the XML.

I know of no such system to convert SPF records to XML, nor any plans
to do so.


Libspf-alt does complete parsing of SPF records into an internal
format that is basically a parse tree.  It then can do various things
with this parse tree, such as print it out in the SPF syntax, evaluate
the record, scan the SPF record for questionable constructs, etc.

It would certainly be possible to print this parse tree in XML format,
but I have no idea how exactly an XML scheme need to look like.  I'm
not even sure if you would want the macro-strings to be represented in
XML, or if you would want to just see the string.

For example, the SPF record "v=spf1 a:smtp.%{d3}/24 -all" could look
something like:

<spf version=1>
  <mechs>
    <a><cidr ipv4=24 />
       <host><literal>smpt.</literal><var name=d chop=3 /></host>
    </a>
    <all match=deny />
  </mechs>
</spf>


It would be very easy to modify libspf-alt's SPF_id2str() function to
create the above stuff, but I have no idea if that would be useful.



-wayne


<Prev in Thread] Current Thread [Next in Thread>