Mailing List Message #6440
From: Patric Malm <>
Subject: Re: Accounf file format
Date: Fri, 7 Jul 2000 17:28:46 +0200
To: SIMS Discussions <>
At 6:13 PM -0700 7/6/00, Patric Malm  imposed structure on a stream of
electrons, yielding:

How can i get any specification about how the account-file is build?

I want to make a webmail in Tango 2000 and need to know how / what i
should be looking for... How i should separate hader from body etc...

Is there any applescript ore something doing this as i can have to
look how i should solve it etc?!

I know of no existing Applescript for this, but the format is almost
exactly a standard BSD mailbox. Each message starts with a line whose
first 5 characters are "From " and ends with a carriage return which is
either the end of file or followed by another message. Hence everywhere
you see "<CR>From " you are seeing a message boundary between the CR and F.

Essentially a message is made up of the leading 'envelope from' line (the
starting "From .*: line) followed by a standard RFC822 message. The format
of the RFC822 message has some subtleties, but is essentially (and safely)
seen as a series of non-empty header lines, a single blank line, then the

In regex notation the mailbox file looks like this:

(^From .*\r(.+\r)*\r(.*\r)*\r)*
  ^        ^        ^        ^

The carets denote in order the start of the message in BSD format, the
start of the RFC822 message, the start of the body, and the end of the BSD
and RFC822 message.

Clear? I hope so.

Hmm, no :-)

When i do that i got a array:
1 row is: whole mailfile, start 1, 13004 (whole file)
2 row is: none, start 0, 0
3 row is: 3 line in the middle of the whole file, start 12844, 160
4 row is whole file (should be that)

I guess that \r is carrige return


- Patric Malm    <- Din tekniker på äpplet      -
- ApplePaj AB       <- Din Mac-specialist NY SIDA! -
- MacNytt       <- Din Mac-community           -
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster