spf-discuss
[Top] [All Lists]

Re: How to built an SPF record that is split in substrings?

2004-04-12 08:34:49
"Meng" == Meng Weng Wong <mengwong(_at_)dumbo(_dot_)pobox(_dot_)com> 
writes:

    Meng> so joining with "" is correct; joining with " " is not.

I disagree.  Currently neither is correct, because the SPF spec
doesn't talk about this issue.

All your argument proves is that joining without a space is more
useful to users of certain nameserver implementations.

Here's how I see it:

1. A TXT record contains a sequence of strings.

2. The SPF spec (and the CID spec for that matter) are worded as if a
   TXT record contains a single string.  It's not clear from the spec
   that an SPF record containing multiple strings is even a valid SPF
   record.  It's certainly not clear how it should be interpreted.

3. BIND has a feature where strings in a TXT record that are longer
   than 255 characters are split into multiple strings.  This is
   non-standard, though arguably harmless, since any zone file that
   contains a string of 256 characters or greater is not strictly
   valid.

4. Tinydns has a feature where strings in a TXT record that are longer
   than 127 characters are split into multiple strings.  Since tinydns
   doesn't use the standard zone file format, it is free to interpret
   its configuration files in any way it chooses.  Tinydns's
   implementation would seem to have the quirk that certain (valid)
   TXT records can't be served, namely those that contain strings
   longer than 127 characters but no longer than 255 characters.

5. (3) and (4) above are quirks of two particular DNS implementations.
   They have nothing to do with the DNS specs or the SPF specs.  (3)
   above is a quirk of how one particular DNS implementation copes
   with invalid zone files; (4) above is a quirk of how one particular
   DNS implementation parses its own non-standard configuration files.

The SPF spec needs to specifically address the issue of whether
multiple strings are allowed, and if so what they mean and whether any
recommendations as to their use.

IMHO this should be done prior to publication an a RFC, if possible.

I would suggest that implementations MUST support multiple strings.  I
don't have strong feelings as to whether we should choose
concatenation with spaces or concatenation without spaces (I think I
tend slightly towards the latter, but both have pros and cons).  But
it's important that we choose one and document it in the spec.

Given the current inconsistency between implementations, I'd also
consider making one or both of the following recommendations:

Publishers SHOULD publish their SPF record in a single string if possible.

Where an SPF record is split into multiple strings, splitting SHOULD
occur adjacent to space characters.

        -roy