MESSAGE
DATE | 2007-11-18 |
FROM | Ron Guerin
|
SUBJECT | Re: [NYLXS - HANGOUT] Website Updates
|
Ruben Safir wrote:
> Folded headers, you mean headers within the body, I assume. The mail is supposed to > move those off the first line of the mail. Mutt itself does this for any
Folded header:
Received: (from ruben-at-localhost) by www2.mrbrklyn.com (8.13.1/8.13.1/Submit) id lAI5qp5f021666; Sun, 18 Nov 2007 00:52:51 -0500
Headers are by definition, not part of the message body. Ever. Any headers you find in the body are not headers. For instance, what I just pasted in here was the header of some other message, but it's not a header of *this* message, it's just body text.
> But most of all, how do you know when you've reached the end of the body? > a blank line isn't enough or every paragraph would look like a new message.
That's totally outside the message protocol. If you use Maildir, each message is a separate file. In mbox, there *is* a delimiter between each message. You need to either use an existing library for parsing mbox files, or find out what delimiter Mutt's been using so you can break these messages apart. A little Googling suggests that Mutt putts A line that starts with _FROM at the start of each message and that any other occurrence of this _FROM header that is not a message delimiter will have been escaped.
Now you can break the messages out and parse them correctly and efficiently.
- Ron
|
|