in reply to Splitting email inbox text into separate messages

If we're talking about UNIX mbox format mailboxes, the first line of the message will always be like:

From foo@example.com Thu Mar 11 22:33:09 2004

From, a space, an e-mail address, and a date stamp. You should be pretty safe in looking for that format in splitting on it.

It's also probable that the mail delivery agent on the system you are getting the mail from is adding a > to the begins of any body line that begins with From.

- Matt Riffle
  VP Technology, pair Networks, Inc.
  (although, I speak only for myself; code is untested unless otherwise stated)
  • Comment on Re: Splitting email inbox text into separate messages