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

udi M <[email protected]> Thu, 26 May 2016 09:39:48 +0300
Newsgroups gmane.mail.procmail
Organization tau
Message-ID <[email protected]>

On 25/05/16 22:41, Xu Wang wrote:
> On Wed, May 25, 2016 at 9:41 AM, LuKreme <[email protected]> wrote:
>> On May 25, 2016, at 07:25, udi M <[email protected]> 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/
> [email protected]
> http://mailman.rwth-aachen.de/mailman/listinfo/procmail