3

I have a raw email with headers that look like this:

From xxxx@xxxx  Fri Apr 25 22:46:08 2003
>From xxxx@mxxxx Wed Feb 19 20:06:07 2003
Envelope-to: yyyy@xxxx
...
Date: Wed, 19 Feb 2003 22:05:59 +0500
From: "Actual Author" <xxxx@xxxx>

I don't know how to interpret the first two lines, and the initial reading of RFC2822 has left me without a clue. They don't look like normal headers and manage to confuse Python 2.7 email parser (fine if I remove the > sign at the start of the second line). I have the same email body in Apple mail's cache, and it seems fine, so the input is clearly correct.

  1. What's that header format? (From <email> <date>\r\n)
  2. Why is the second one prefixed with > (greater sign)?
Community
  • 1
  • 1
Alex B
  • 82,554
  • 44
  • 203
  • 280

1 Answers1

2

What you have is a mail in mbox format, where the first "From" line marks the start of the message. The second line (>From) seems to be caused by the escaping strategy of mbox known as From quoting - has this message been double-encoded as mbox?

Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93
  • Funny thing, though, is that I get this raw message body over IMAP (it was imported into Gmail from another mail server long time ago), and it's claimed to be RFC822 format. – Alex B Jun 10 '13 at 09:00