Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

email

rfc2822

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)?
like image 252
Alex B Avatar asked Jan 29 '26 05:01

Alex B


1 Answers

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?

like image 178
Anders Lindahl Avatar answered Jan 31 '26 23:01

Anders Lindahl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!