* Reinier Post via RT (bug-Mail-Box@rt.cpan.org) [090320 11:03]:
Show quoted text> Fri Mar 20 07:03:41 2009: Request 44439 was acted upon.
> Transaction: Ticket created by rpost
> Queue: Mail-Box
> Subject: the takemail script doesn't output From separators
> Broken in: 2.087
> Severity: Important
> Owner: Nobody
> Requestors: reinpost@win.tue.nl
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=44439 >
>
> Looking for a script to scan through my Unix mbox files and return an
> mbox file with all messages meeting some criterion (e.g. from within the
> last month), I found Mail::Box and the takemail script, which looks like
> it's designed to do that. But it doesn't: it forgets to put the
> From-lines on the messages in the output, with the consequence that the
> output isn't a mbox file.
[laten we het maar in het Engels houden, ter documentatie]
The takemail script was contributed a long time ago (somewhere in 2002),
so I do not know the ins and outs of it. It seems (from the name of
the parameters) that the author used MailDir.
It probably depends on how you are calling it. Can you give me an
example?
You can easily achieve the same thing in Mail::Box directly, without
script. That should work, because there are regression tests to
protect that functionality.
# untested
my $mgr = Mail::Box::Manager->new(...);
my $in = $mgr->open($infn);
my $out = $mgr->open($outfn, access => 'w', create => 1);
foreach my $msg ($in->messages)
{ if(...some condition...)
{ $mgr->copyMessage($msg, $out);
}
}
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net