Re: MIME boundary strings

Russ Allbery <rra@stanford.edu> Thu, 22 August 2002 13:26 UTC

Received: from localhost (localhost [[UNIX: localhost]]) by above.proper.com (8.11.6/8.11.3) id g7MDQin21351 for ietf-822-bks; Thu, 22 Aug 2002 06:26:44 -0700 (PDT)
Received: from windlord.stanford.edu (windlord.Stanford.EDU [171.64.13.23]) by above.proper.com (8.11.6/8.11.3) with SMTP id g7MDQh221343 for <ietf-822@imc.org>; Thu, 22 Aug 2002 06:26:43 -0700 (PDT)
Received: (qmail 14376 invoked by uid 50); 22 Aug 2002 13:26:39 -0000
To: ietf-822@imc.org
Subject: Re: MIME boundary strings
References: <p0510033db98a5c7c98f8@[192.168.100.100]>
In-Reply-To: <p0510033db98a5c7c98f8@[192.168.100.100]> (Jacob Palme's message of "Thu, 22 Aug 2002 11:27:15 +0200")
From: Russ Allbery <rra@stanford.edu>
Organization: The Eyrie
Date: Thu, 22 Aug 2002 06:26:38 -0700
Message-ID: <yld6sbyqgh.fsf@windlord.stanford.edu>
Lines: 38
User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Honest Recruiter, sparc-sun-solaris2.6)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Sender: owner-ietf-822@mail.imc.org
Precedence: bulk
List-Archive: <http://www.imc.org/ietf-822/mail-archive/>
List-ID: <ietf-822.imc.org>
List-Unsubscribe: <mailto:ietf-822-request@imc.org?body=unsubscribe>

Jacob Palme <jpalme@dsv.su.se> writes:

> MIME specifies that the boundary string between body parts must be a
> string which does not occur in the body part itself. This goal can be
> achieved in two ways:

> (a) Try out different boundary string, until a string can
>      be found which does not occur.

Gnus uses this method, FWIW.  It also uses sane boundary strings
(combinations of - and =) that actually look like boundaries to people who
see the raw message, rather than the alphanumeric mess that most clients
use and that confuses the eye when looking at the raw message.

(I've long been of the opinion that MIME wouldn't have encountered as much
resistance as it did if the early implementors had used sane boundary
markers and not reiterated the default headers at the beginning of each
part; in other words, if they'd given some thought to how the message
looked to non-MIME-compliant readers.)

> (b) Select a sufficiently long random boundary string,
>      that the probability that it occurs in the body
>      part is negligible. This method is not really
>      permitted according to RFC 2046.

> I have an impression that many mail programs use method (b). And that
> some use method (b) but do not even select a really random boundary
> string.

I have the same impression.

Most versions of Eudora also have an interesting bug wherein when forming
nested multiparts, some percentage of the time the exterior boundary will
be a prefix of the interior boundary.  I think they've finally fixed this
in the latest release.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>