Re: Extract last email from an email file (mbox format)
"John Levine" <[email protected]> 27 May 2016 01:51:09 -0000
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
>I think I have a fundamental misunderstanding somewhere. Perhaps I am >not using the mbox format? The file I wish to get last message of is >the send file from mutt. Here is the last message, for example: ---------------------------------begin last message From [email protected] Thu May 26 20:55:32 2016 That line begins with From followed by a space, which is what '^From ' matches. You might want to look for some tutorials on regular expressions if you don't understand how they work. >From: will this be matched? Nope, has a colon. >From how about this one? If the mbox is created by any of the usual mail programs, the mail program puts a > in front of any line that might otherwise match '^From '