🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #272

Re: mbox format problem

#272
From: Kurt Hackenberg
Date: Tue, 15 Feb 2011 21:53
47 lines
3287 bytes
Julian Bradfield  <jcb@inf.ed.ac.uk> wrote:
>On 2011-02-15, Kurt Hackenberg <kh@pnnnnx.kom> wrote:
>> Julian Bradfield  <jcb@inf.ed.ac.uk> wrote:
>>>A sensible format would use content-length...
>> No, because content-length is number of bytes in the message body,
>> which includes end-of-line characters and such, so it varies across
>> systems.  If you move the file from one system to another, it breaks.
>
>Er, it's up to the MTA/MUA to maintain the Content-Length correctly if
>they do anything other than make a perfect binary copy.
>The format already exists, and VM already supports it.

I was talking about moving the file outside of the mail software.
Say, with FTP or similar.  Useful for import/export, archive, etc.

>> I've had an idea to use the dot-stuffing algorithm used by SMTP: a
>> message is terminated by a line containing nothing but '.'; any such
>> line in the message gets another '.' added at the front.
>
>You also need to stuff any line containing only dots, of course.

That's what I said.

>That's what From-stuffing is like, and it's evil. It should not be
>necessary to mangle a message in order to store it.

No, SMTP's dot-stuffing is reversible.  The original message is easily
restored.  Every mail message sent across the Internet goes through
this: the sending MTA dot-stuffs the message, the receiver undoes it.

From-stuffing is not reversible, because a message line starting with
">From " doesn't get a second '>', so it becomes impossible to know
whether the '>' was there originally or added later.  That information
is lost.  That's the evil.

SMTP's algorithm, from RFC 5321 (descendant of 821), section 4.5.2:

   o  Before sending a line of mail text, the SMTP client checks the
      first character of the line.  If it is a period, one additional
      period is inserted at the beginning of the line.

   o  When a line of mail text is received by the SMTP server, it checks
      the line.  If the line is composed of a single period, it is
      treated as the end of mail indicator.  If the first character is a
      period and there are other characters on the line, the first
      character is deleted.
Technical Details
Message-ID: <ijesl3$p4s$1@reader1.panix.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!transit4.readnews.com!panix!not-for-mail
References: <8739nuxoil.fsf@cervantes.cervantes.es> <slrnile2c1.q00.jcb@krk.inf.ed.ac.uk> <ijchgd$7u1$1@reader1.panix.com> <slrnilkfcs.pm1.jcb@krk.inf.ed.ac.uk>

Show Full Headers
Complete Article Headers
X-Google-Thread: a16957f451,681143edebf5735e
X-Google-Attributes: gida16957f451,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!transit4.readnews.com!panix!not-for-mail
From: kh@pnnnnx.kom (Kurt Hackenberg)
Newsgroups: gnu.emacs.vm.bug
Subject: Re: mbox format problem
Date: Tue, 15 Feb 2011 21:53:39 +0000 (UTC)
Organization: Public Access Networks Corp.
Lines: 47
Message-ID: <ijesl3$p4s$1@reader1.panix.com>
References: <8739nuxoil.fsf@cervantes.cervantes.es> <slrnile2c1.q00.jcb@krk.inf.ed.ac.uk> <ijchgd$7u1$1@reader1.panix.com> <slrnilkfcs.pm1.jcb@krk.inf.ed.ac.uk>
NNTP-Posting-Host: panix2.panix.com
X-Trace: reader1.panix.com 1297806819 25756 166.84.1.2 (15 Feb 2011 21:53:39 GMT)
X-Complaints-To: abuse@panix.com
NNTP-Posting-Date: Tue, 15 Feb 2011 21:53:39 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)