Subject: Separating Messages

From: Jago <[email-masked]>
Date: Sun, 5 Jan 1997 19:51:58 -0500

I've developed a software that purges new mail messages in /var/mail, and
it worked fine until some users switched from ELM to PINE.  How does PINE
separate the messages?  I thought a good start was to look for "From"
(does it also use linefeeds?), but this can be a problem if the body of
messages contain "From" as well.  Somehow PINE is smart enough to handle
the messages.  Any ideas?

--
{--------------------------------------------------------------------------}
{ Name: Steven C. King               Institution: Florida State University }
{ Addr: [email-masked]  Major field: MM Performance           }
{       [email-masked]            Instruments: Clarinet, piano (hobby)  }
{ URL:  http://otto.cmr.fsu.edu/~kings/ - MIDI, Humor, KI2, Pictures, etc. }
{                        "The way to do is to be."                         }
{--------------------------------------------------------------------------}

---

From: Mike Brudenell <[email-masked]>
Date: Wed, 8 Jan 1997 10:06:02 +0000 (GMT)

The question is really not so much "How does Pine separate messages in a
folder?" but "Which mailbox format are you using?"

Whereas Elm, as far as I recall, supports only one/a few mailbox formats
Pine supports many.  How the messages are stored and separated can be very
different in each format, so it _is_ important which one you are using.

That said, most places use the so-called "Berkeley" format.  With this
each message is of the format:

From blah blah blah
Header1: value
Header2: value
Header3: value
				<--- empty line (important!)
...text of message...

Particular points to note:

*  Each message is introduced by a line starting "From " (note the
   trailing space; this differentiates the line from the "From:" header
   line).

*  The text after the "From " is often in a variety of formats, and its
   content shouldn't really be relied upon (eg, Pine rewrites it when
   resaving the mailbox).  Use the proper "HeaderN: value" lines instead.

*  The empty line after the last header signifies the end of the headers,
   and the start of the message body text.  This prevents software getting
   confused over initial lines of a message which happen to look like
   header lines.

*  The mail software (delivery softare, Pine, etc) almost invariably
   "quotes" any lines within a message body which start "From " to become
   ">From".  This prevents spurious start-of-message's.  (But note that
   Pine has, as far as I recall, an option to turn this quoting off
   somewhere, although it is rarely used I guess!)

Cheers,

-- 
Mike Brudenell                                         <[email-masked]>
------------------------------------------------------------------------
The Computing Service, University of York, Heslington, York, YO1 5DD, UK
Tel: +44-1904-433811  FAX: +44-1904-433740  http://www.york.ac.uk/~pmb1/