tobold.org

correct • elegant • free

△ comp.mail.* △

◅ Newbie: Is there a FAQ and what is the current status?

Content-Length and MIME encodings ▻

Content-Length and MIME encodings

In article <2hs1pa$igh@grasp.insa-lyon.fr>, Christophe Wolfhugel
<Christophe.Wolfhugel@grasp.insa-lyon.fr> wrote:
>Some agents do add the Content-Length header to the message for
>adding the size of the enclosed body.  When encoding occurs on a
>mail gateway (say from 8bit to quoted-printable), the size usually
>changes.  Must the encder update the value indicated in the
>Content-Length header (meaning 2 passes) or is it acceptable to drop
>the Content-Length header, if the length does change and the gateway
>is not willing to perform the work in 2 passes ?

`Content-Length:' is not defined in any RFC.  I would suggest you pass
it through intact, on the grounds that---not knowing the syntax, let
alone the semantics---you can't update it, and you shouldn't simply
delete it.

I understand that it is used by certain System V based systems to find
the end of each message in a mail drop: the value is something like
the number of octets from the end of the message headers to the end of
the message body.  (No, this isn't an exact definition.  I don't know
the details, and don't want to.)  Whether or not you think this is a
sensible scheme, it's clear that any sane system *must* recalculate
the `Content-Length:' of incoming messages, or risk the possibility of
(accidental or deliberate) corruption of the mail drop.

Now, I happen to have a mail system where `Content-Length:' indicates
the length, in inches, of the message when printed in 10-point type.
Since conversion from 8bit to q-p doesn't affect this value, I would be
very upset if your gateway changed it.

What do you mean, I should have used an `X-' header?  AT&T didn't...

Tim.
--
Tim Goodwin | "scanf()... usually does something almost but not
PIPEX Ltd   | completely unlike what you want" -- Chris Torek.

Original headers:

From: tim@pipex.net (Tim Goodwin)
Newsgroups: comp.mail.mime,comp.mail.headers
Subject: Re: Content-Length and MIME encodings
Date: 23 Jan 1994 18:59:37 -0000
Organization: PIPEX Ltd, Cambridge, UK.
Message-ID: <2huhep$1m4@tank.pipex.net>
References: <2hs1pa$igh@grasp.insa-lyon.fr>

△ comp.mail.* △

◅ Newbie: Is there a FAQ and what is the current status?

Content-Length and MIME encodings ▻