procmail
[Top] [All Lists]

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

2016-05-26 17:07:32
On Thu, May 26, 2016 at 2:39 AM, udi M 
<uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il> wrote:


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)

Thank you for all of your replies! Yes I would like to use formail but
I do not want to process all the emails. I still wonder if I can just
process the last without going through every single one before the
last. The tac solutions above or tail solutions are more efficient but
the formail is more safe. I wish there were something that combined
both. But perhaps I must choose between efficiency and safety.

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