ietf-822
[Top] [All Lists]

Re: MIME boundary question

1995-02-09 11:22:31
On Thu, 9 Feb 1995, Steve Dorner <sdorner(_at_)qualcomm(_dot_)com> wrote:
Consider the following fragment:

multipart/mixed; boundary="outer"

--outer
multipart/mixed; boundary="outer-inner"

--outer-inner

stuff

--outer-inner--
--outer--

I have a vendor claiming that this is illegal because the "outer" appears
in the boundary "outer-inner", and thus violates the need for the
boundaries to be unique.  Their claim is in fact that "outer" must appear
NOWHERE in the body--not merely that "--outer<CRLF>" must not appear in the
body.

I think this is absolutely preposterous.  I think that the uniqueness
requirement means that the string "--outer<CRLF>" must not appear as body
contents, but that "--outer-inner<CRLF>" is perfectly OK (so far as the
outer multipart goes), and that the fragment above is therefore perfectly
ok.

What say you all?  Have I misread the RFC?  Has the other vendor?  Does the
RFC need to be clarified?

On first pass, I thought you were right and the vendor wrong.  But after
careful reading, I changed my mind.  Therefore, my answer to your last 3
questions are Yes, No and Yes.

RFC 1521, section 7.2.1, second paragraph states (top of page 30):

   The encapsulation boundary is defined as a line consisting entirely of
   two hyphen characters ("-", decimal code 45) followed by the boundary
   parameter value from the Content-Type header field.

And further down (top of page 31) it says:

   that the initial CRLF is considered to be attached to the encapsulation
   boundary rather than part of the preceding part.

This last bit is what I missed on my first reading, and once considered,
what changed my mind.  I read it to mean that "outer" and even "--outer"
would be legal in an encapsulated part, but that "<CR><LF>--outer" would
be illegal.

I believe that an addition like:

   Note: the boundary parameter value may appear inside an encapsulated part,
         as long as it is not preceded by "<CR><LF>--".  For example:

              Content-Type: multipart/mixed; boundary="blah"

         The string "blah" may appear in an encapsulated part, as well as
         the string "--blah", but the string "<CR><LF>--blah" may not.

         Thus the inner boundary in the following example would be illegal:

              Content-Type: multipart/mixed; boundary="outer"

              --outer
              Content-Type: multipart/mixed; boundary="outer-inner"

              --outer-inner

              stuff

              --outer-inner--
              --outer--

Of course, this is just my read on the text of the RFC.  Whether others
agree with my reading or not, the only thing I feel stronly about is that
an example should be added to explicitly state which such strings are and
are not legal in an encapsulated part.

-- John
************************************************************************
*  o _ |_ __  +  |_  _  _ |/    John T. Beck                           *
*  |(_)| || | (_ |_)(/_(_ |\    Software Development Engineer          *
* \/  ___________________)      Hewlett-Packard Company, Cupertino, CA *
*    (______________            jbeck(_at_)cup(_dot_)hp(_dot_)com               
        *
************************************************************************

<Prev in Thread] Current Thread [Next in Thread>