Mailing List Archive

YAML format
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here's a YAML conversion of Stuart's test.dat file (with no check for
sanity of the actual test data). It is not meant as a polished proposal
for a YAML-based format, but merely to give an idea of how it would look.

I chose to represent each tuple of (records, tests) as an independent
YAML "document" (the parts separated by "---"), because that's what they
essentially are: independent.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEpckrwL7PKlBZWjsRAuyFAKCp202JJgNT30tSK5Kfbwb/l3yrOwCfX3DH
d4GIX7kUb2SONYiBEWSACHM=
=RKov
-----END PGP SIGNATURE-----
Re: YAML format [ In reply to ]
On Sat, 1 Jul 2006, Julian Mehnle wrote:

> Tests:
> exists-fail:
> Spec: ...
> Description: ...
> Host: 1.2.3.4
> Helo: mail.example.net
> Mail From: lyme.eater@example.co.uk
> Result: Fail
> exists-pass:
> Spec: ...
> Description: ...
> Host: 1.2.3.5
> Helo: mail.example.net
> Mail From: lyme.eater@example.co.uk
> Result: Pass

Could we keep the test field names one word to keep the BIND format parsing
trivial? E.g.

exists-pass:
Spec: ...
Description: ...
Host: 1.2.3.5
Helo: mail.example.net
MailFrom: lyme.eater@example.co.uk
Result: Pass

--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: YAML format [ In reply to ]
On Sat, 1 Jul 2006, Julian Mehnle wrote:

> Records:
> example3.com:
> - SPF: "v=spf1mx"
> - SPF: "v=spf1 mx"
> - MX: [0, mail.example1.com.]

It is not clear how to generate the above in python YAML lib.
It doesn't seem to like multiple instances of field names, wanting
to use the !!pair format instead. I'll keep playing.

As the testcase czar, I insist on one word field names, but will accept
Julian's change of MFROM to MAILFROM. :-) This avoids problems when
converting to other structured formats which may not support fancy
field names.

--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: YAML format [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stuart D. Gathman wrote:
> On Sat, 1 Jul 2006, Julian Mehnle wrote:
> > Records:
> > example3.com:
> > - SPF: "v=spf1mx"
> > - SPF: "v=spf1 mx"
> > - MX: [0, mail.example1.com.]
>
> It is not clear how to generate the above in python YAML lib.
> It doesn't seem to like multiple instances of field names, wanting
> to use the !!pair format instead. I'll keep playing.

The Perl structure of the above looks like this:

| 'example3.com' => [.
| { 'SPF' => 'v=spf1mx' },
| { 'SPF' => 'v=spf1 mx' },
| { 'MX' => [ '0', 'mail.example1.com.' ] }
| ]

So the records are essentially a sequence of mappings (hashes), even if
every mapping contains only one key/value pair. The mappings could be
replaced by sequences containing the RR type and content...

| example3.com:
| - [SPF, "v=spf1mx"]
| - [SPF, "v=spf1 mx"]
| - [MX, [0, mail.example1.com.]]

...but that shouldn't make a significant difference in most languages'
internal data structure formats, and would only make the YAML
representation more difficult to read.

Explicitly keyed mappings would also be possible...

| example3.com:
| -
| Type: SPF
| Content: "v=spf1mx"
| -
| Type: SPF
| Content: "v=spf1 mx"
| -
| Type: MX
| Content: [0, mail.example1.com.]]

...but that would be exceedingly verbose.

> As the testcase czar, I insist on one word field names, but will accept
> Julian's change of MFROM to MAILFROM. :-) This avoids problems when
> converting to other structured formats which may not support fancy
> field names.

Ok. What about "Mail-From"? That avoids whitespace anyway.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEprSOwL7PKlBZWjsRAvhDAJ9ZaRVGd8Icp1T+qBreTbrAUwg+hACgnSvr
gmOJu6iq55pCRwgY7722Yjs=
=+osz
-----END PGP SIGNATURE-----

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com