Re: Extract last email from an email file (mbox format)

Zhiliang Hu <[email protected]> Fri, 27 May 2016 09:09:57 -0500 (CDT)
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On Thu, 26 May 2016, Xu Wang wrote:

> Date: Thu, 26 May 2016 21:03:15 -0400
> From: Xu Wang <[email protected]>
> Subject: Re: Extract last email from an email file (mbox format)
>
> Hello, this is....
> From: will this be matched?
>> From how about this one?
> ---------------------------------end last message
>
> So this is why I am not sure matching regex with "^From " is safe. It
> will also match in the body.

As a tradition, when a mail is saved into mbox format, any leading "From" 
line is prefixed with ">" as in your example.

You could use 'H' or 'h' flag in your little rc file to check headers 
only.

Zhiliang