Re: [dnsext] loads of TXT records for fun and profit

Phil Pennock <namedroppers+phil@spodhuis.org> Fri, 03 May 2013 23:33 UTC

Return-Path: <namedroppers+phil@spodhuis.org>
X-Original-To: dnsext@ietfa.amsl.com
Delivered-To: dnsext@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DF7C021F8D27 for <dnsext@ietfa.amsl.com>; Fri, 3 May 2013 16:33:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.253
X-Spam-Level: *
X-Spam-Status: No, score=1.253 tagged_above=-999 required=5 tests=[AWL=3.253, BAYES_00=-2.599, J_CHICKENPOX_37=0.6, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IaONxFpa7Qb5 for <dnsext@ietfa.amsl.com>; Fri, 3 May 2013 16:33:03 -0700 (PDT)
Received: from mx.spodhuis.org (smtp.spodhuis.org [IPv6:2a02:898:31:0:48:4558:736d:7470]) by ietfa.amsl.com (Postfix) with ESMTP id 5DF6121F8C33 for <dnsext@ietf.org>; Fri, 3 May 2013 16:33:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=HWia+E5ChBxUbi87oreRze6svqjylqfy+dYscuVa7tI=; b=I+axxvT3jieZFthHZxoc8yESx5n+t9ks/QbVh71S/8pcCPeKuKZP20+WEjb5X2XnvPxfwuplBZlO8x/1uDdPDRIPZiEdHdfpJ4UvPT+hQ+9jx8O1yGPZAvPDWcfI/7HusKzO7D7Qt6plGIJ6fDY6bvS0Sr/9Y+oKBsm1xLyoymM=;
Received: from [::1] (port=53093 helo=localhost) (helo=localhost) by smtp.spodhuis.org with esmtp id 1UYPSn-0006Of-6Q; Fri, 03 May 2013 23:33:02 +0000
Date: Fri, 03 May 2013 18:00:31 -0400
From: Phil Pennock <namedroppers+phil@spodhuis.org>
To: David Conrad <drc@virtualized.org>
Message-ID: <20130503220031.GA23507.take2@redoubt.spodhuis.org>
References: <80ADB3EE-17FD-4628-B818-801CB71BCBFE@virtualized.org> <alpine.BSF.2.00.1304242309150.38677@joyce.lan> <46778ED3-35A2-44B4-BE3C-AAC4F7B314FF@virtualized.org> <92BBD83F-676D-4B05-B927-4101DD5CAD3E@neustar.biz> <DC121025-A014-492B-AFAD-22CDE49D866E@rfc1035.com> <CAMm+Lwi4MAjX8BAk_ro9usf6AJo=1UERhGBJ1rUa-AbrX09dqg@mail.gmail.com> <E5E3F801-6490-48A8-A12F-A6561893D78A@icsi.berkeley.edu> <D00A1E79-40F2-4EFF-975C-8618C7AC750A@virtualized.org> <20130503203921.GA22566@redoubt.spodhuis.org> <EB1F5846-C500-4277-90EA-CF37923A0212@virtualized.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <EB1F5846-C500-4277-90EA-CF37923A0212@virtualized.org>
Cc: dnsext@ietf.org
Subject: Re: [dnsext] loads of TXT records for fun and profit
X-BeenThere: dnsext@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: DNS Extensions working group discussion list <dnsext.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsext>, <mailto:dnsext-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/dnsext>
List-Post: <mailto:dnsext@ietf.org>
List-Help: <mailto:dnsext-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsext>, <mailto:dnsext-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 03 May 2013 23:33:04 -0000

On 2013-05-03 at 14:01 -0700, David Conrad wrote:
> Phil,
> 
> On May 3, 2013, at 1:39 PM, Phil Pennock <namedroppers+phil@spodhuis.org> wrote:
> > That is not my understanding as a reader of RFC4408 and as someone who
> > worked with the coder (and documented the results) for the handling of
> > TXT records in a widespread MTA to be as flexible as possible and to
> > support SPF-style lookups.
>
> Last sentence of RFC 4408, section 3.1.3:
>
> "  SPF or TXT records containing multiple strings are useful in
>    constructing records that would exceed the 255-byte maximum length of
>    a string within a single TXT or SPF RR record."
>
> Sure sounds to me like 4408 anticipates multiple TXT RRs.

One TXT RR contains one or more strings, each of maximum length 255.

To rip an example I wrote for Exim docs:
   
      foo.example.  IN TXT "a" "b" "c"
      foo.example.  IN TXT "d" "e" "f"

      ${lookup dnsdb{>/ txt=foo.example}}   -> "a/d"
      ${lookup dnsdb{>/; txt=foo.example}}  -> "def/abc"
      ${lookup dnsdb{>/,+ txt=foo.example}} -> "a+b+c/d+e+f"

That's two RRs, each with three strings.

You can also look up spftest$N.test.globnix.net for N in 1..6 for more
examples.  N 2, 3 and 6 are most relevant.  (Both SPF=99 and TXT records
are present.)

spftest6 is fun, in that it breaks into multiple strings in the middle
of "v=spf1", which is absolutely allowed by the SPF specification.

-Phil