Re: Extract last email from an email file (mbox format)
Xu Wang <[email protected]> Sun, 29 May 2016 17:09:49 -0400
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <CAJhTkNjfGU2HrpsNVOk9ykBneJWe=EiH8gYpaNpKrcmg-_TQbw@mail.gmail.com> |
On Fri, May 27, 2016 at 3:45 PM, Xu Wang <[email protected]> wrote: > On Fri, May 27, 2016 at 10:09 AM, Zhiliang Hu <[email protected]> wrote: >> 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. > > I see, so mutt must not be using mbox format then because it does not do that. Aha! I have just to learn that there are many implementations of mbox and not all of them use From munge (the term for escaping from lines in the body). For example, mboxcl2 does not and instead relies on use of Content-Length:. Mystery is solved! Bad news is that I cannot use the "^From " regex then. It is not safe for mboxcl2. Kind regards, Xu