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

Xu Wang <[email protected]> Sun, 29 May 2016 23:14:08 -0400
Newsgroups gmane.mail.procmail
Message-ID <CAJhTkNjvZg56YYNDRCHyzzqDS1KVSjC8bHygBR0zVsnn61T6eA@mail.gmail.com>
On Sun, May 29, 2016 at 8:59 PM, @lbutlr <[email protected]> wrote:
> On Sun May 29 2016 14:11:24 Xu Wang     <[email protected]> said:
>>
>>> 3.   It is fast.
>>
>> Unfortunately not for me.
>>
>> time formail  -s  tee oneMessageOnly < theBigBox
>>
>> real 0m24.019s
>> user 0m3.376s
>> sys 0m4.484s
>>
>> As mentioned, my file is huge:
>> $ wc -l theBigBox
>> 2171183 theBigBox
>
> Well, 24 seconds to process 2 million lines of largely unstructured text is pretty fast. You could make it faster with a faster disk, of course.
>
> The REAL solution is not to have an mbox file with over 2 million lines.

I do not want to process 2 million lines (by the way I think most of
these occur because of large attachments). I just want to process the
last hundred or so, which is not so crazy. The tac solutions take this
approach.

>
> There is *no* reason to use mbox over maildir. It is inefficient and fragile.

Well, I believe there is a simple reason: the mutt default is to have
~/sent use mbox. And I want to write a script for general users. When
producing software for others, it is best not to make choices for
them. Otherwise you become Apple (I have no problem with Apple, many
people prefer to have choices made for them. But I do not.).

Thank you for your help and time. I do appreciate.

Kind regards,

Xu