spf-discuss
[Top] [All Lists]

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

2004-04-08 13:30:27
On Thu, Apr 08, 2004 at 08:37:23AM -0500, wayne wrote:
| 
| There are multiple substrings in a single TXT record.  See RFC1035.
| 
| The strings in a TXT record are a one-byte length followed by that
| many bytes optionally followed by more substrings.
| 
| It appears that djbdns assumes that the length is a signed char and
| therefore limits all strings to 127 bytes, while BIND assumes the
| length is unsigned.  
| 

as evidence, starting with the tinydns record:

    20040408-16:29:02 root(_at_)flatbox:/var/service/tinydns/root# grep long209 
data
    'long209.spf1-test.mailzone.com:this is a very long text record containing 
a whopping two hundred and ten characters.  it is used to see whether stuff 
breaks; you can use it to test all kinds of clients.  sometimes you need to 
join a result.:60

you get:

    20040408-16:28:02 mengwong(_at_)dumbo:~% dig +short 
long209.spf1-test.mailzone.com txt
    "this is a very long text record containing a whopping two hundred and ten 
characters.  it is used to see whether stuff breaks\; " "you can use it to test 
all kinds of clients.  sometimes you need to join a result."

note the separation after the semicolon.  so in applications you have to do:

    20040408-16:27:57 mengwong(_at_)dumbo:~% perl -MNet::DNS -le 'my $res = 
Net::DNS::Resolver->new(); my $query = $res->query(shift, "TXT"); print 
$res->errorstring if not $query; for ($query->answer) { for ($_->char_str_list) 
{ print "*** $_" } }' long209.spf1-test.mailzone.com
    *** this is a very long text record containing a whopping two hundred and 
ten characters.  it is used to see whether stuff breaks;
    *** you can use it to test all kinds of clients.  sometimes you need to 
join a result.

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