Re: [art] Seeking clarification on boundary delimiters in RFC 2046

Ned Freed <ned.freed@mrochek.com> Sun, 22 July 2018 15:21 UTC

Return-Path: <ned.freed@mrochek.com>
X-Original-To: art@ietfa.amsl.com
Delivered-To: art@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 57FB8130DEC for <art@ietfa.amsl.com>; Sun, 22 Jul 2018 08:21:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=mrochek.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Codbv-XAdjbp for <art@ietfa.amsl.com>; Sun, 22 Jul 2018 08:21:07 -0700 (PDT)
Received: from mauve.mrochek.com (mauve.mrochek.com [68.183.62.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B91C4124D68 for <art@ietf.org>; Sun, 22 Jul 2018 08:21:07 -0700 (PDT)
Received: from dkim-sign.mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QV5Z5KCB0G00815D@mauve.mrochek.com> for art@ietf.org; Sun, 22 Jul 2018 08:15:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mrochek.com; s=201712; t=1532272558; bh=xD0G1TFt+CXnd/dZcDpm2ZNv/UwTNfkJ8Yjj9vnozXo=; h=Cc:Date:From:Subject:In-reply-to:References:To:From; b=UBIXT0drUaNsZ/7B15lGZlfzJe4QisCUeKUayS9TrwXsV5/8xzzJYmXLaqkKNWQYu fyhYqAOb79vzMxxJB2YTUl0wW7KQDI9KNuW3kJTuFSpBt3renIrxa2g8DXF/m1YLKN zQG2EeeDuwB7oJHOtd2jr26OtbcbVcc0B7bA/HfQ=
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: TEXT/PLAIN; CHARSET="us-ascii"
Received: from mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QUCIBNY1B4000051@mauve.mrochek.com>; Sun, 22 Jul 2018 08:15:53 -0700 (PDT)
Cc: "art@ietf.org" <art@ietf.org>
Message-id: <01QV5Z5GEG3G000051@mauve.mrochek.com>
Date: Sun, 22 Jul 2018 08:12:09 -0700
From: Ned Freed <ned.freed@mrochek.com>
In-reply-to: "Your message dated Sun, 22 Jul 2018 00:12:33 -0400" <5b54042e.1c69fb81.952a3.f6a8@mx.google.com>
References: <5b54042e.1c69fb81.952a3.f6a8@mx.google.com>
To: Peter Occil <poccil14@gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/art/pf8l8FoY8vSCQf61DO9DsqY84es>
Subject: Re: [art] Seeking clarification on boundary delimiters in RFC 2046
X-BeenThere: art@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Applications and Real-Time Area Discussion <art.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/art>, <mailto:art-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/art/>
List-Post: <mailto:art@ietf.org>
List-Help: <mailto:art-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/art>, <mailto:art-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 22 Jul 2018 15:21:10 -0000

> RFC 2046 sec. 5.1 contains the following:

>    NOTE TO IMPLEMENTORS:  Boundary string comparisons must compare the
>    boundary value with the beginning of each candidate line.  An exact
>    match of the entire candidate line is not required; it is sufficient
>    that the boundary appear in its entirety following the CRLF.

> Say a message has the following media type:

>    multipart/mixed; boundary="b1"

> It seems obvious that the following all work the same way as marking the next
> body part in the message:

>    --b1

>    --b1BOUNDARY

>    --b1 (followed by whitespace)

> What is not clear is whether any or all of the following work as
> the boundary delimiter marking the end of all body parts (no example
> is included in RFC 2045 clarifying this matter):

This is why we have ABNF. And the ABNF is very clear - the dash-boundary must
immediately follow the delimiter to be considered to be a closing delimiter:

   close-delimiter := delimiter "--"

>    --b1--

This is a close-delimiter.

>    --b1BOUNDARY--

This is a dash-boundary but not a close-delimiter.

>    --b1--BOUNDARY

This is a close-delimiter.

>    --b1--  (followed by whitespace)

This is a close-delimiter.

>    --b1--BOUNDARY (followed by whitespace)

This is a close-delimiter.

> Can this be clarified?

Why? The ABNF spells this out very clearly.

				Ned