[CentOS] extract MIME attachments from 700MB imap folder
centos at swhi.net
Tue Jul 1 19:33:57 UTC 2008
Les Mikesell wrote:
> Ray Leventhal wrote:
>>>> I've read the man page, but am wholly unclear as to:
>>>> 1) will this do the trick for me
>>>> 2) are there other known tools which might be recommended
>>> Mime::Parser will split out the body and attachments of a message
>>> into files. I've only used it on single files being delivered via
>>> procmail like this:
>>> use MIME::Parser;
>>> ### Create parser, and set some parsing options:
>>> my $parser = new MIME::Parser;
>>> ### Change how nameless message-component files are named:
>>> ### Parse input:
>>> $entity = $parser->parse(\*STDIN) or die "parse failed\n";
>>> But you'll probably want to do something a little more clever to
>>> toss the body and use sensible filenames for the attachments. I
>>> think Mime::Parser::Filer can do that.
>> Hi Les,
>> Thanks for your reply.
>> I'm wholly ignorant of how to go about doing this using your
>> suggestion. Are there resources to which you might point me for
>> additional info?
> That was the whole perl program needed to split the body of a message
> and any MIME attachments into separate files, given one email message
> on standard input. If that doesn't make sense, you'll probably have
> to start with the 'learning perl' book or any general perl programming
> tutorials. There are some details about the Mime::Tools package and
> how to use the components here:
Thanks, Les. I'm digging into the docs now.
More information about the CentOS