How to understand these email header fields? ("From" field prefixed with a "greater" sign)

StackOverflow https://stackoverflow.com/questions/17019821

  •  31-05-2022
  •  | 
  •  

Question

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)?
Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top