procmail
[Top] [All Lists]

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

2016-05-26 22:00:41
On Thu, May 26, 2016 at 9:51 PM, John Levine 
<johnl-procmail(_at_)iecc(_dot_)com> wrote:
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 xu(_dot_)wang762(_at_)gmail(_dot_)com 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.

Regular expressions are actually the only part of this conversation
that I feel much confidence in.

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 '

OK this is the root of the misunderstanding. I'm not sure why but mutt
has not done this.

Kind regards,

Xu
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>