procmail
[Top] [All Lists]

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

2016-05-26 01:49:56


On 25/05/16 22:41, Xu Wang wrote:
On Wed, May 25, 2016 at 9:41 AM, LuKreme <kremels(_at_)kreme(_dot_)com> wrote:
On May 25, 2016, at 07:25, udi M <uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il> 
wrote:
What I do for splitting:
1)  cat  little.rc
:0
mydir/

2)  formail -s procmail  ./little.rc  < theBigBox
Yep. That's what I'd do as well, but I also regard mbox as an abomination.
Thank you to all for every response! I will spend time to test and investigate.

I wonder if the solutions that rely on regex match of "From:" are
robust. Is it safe to use? Or there is fear that e.g. a line in body
of message begins with From: it could match? I suppose I should test.

Yes, you right,  using  awk(1), sed(1)  and so are not save for this case!!!
See my last answer using  formail(1)  which was designed
to do this jobs.   (This command is very simple too)

--udi


Thank you!

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

____________________________________________________________
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