Issue:
I've been tasked with extracting a bunch of MIME attachments (M$Word
docs) from emails which have been stored in an imap folder in
/home/<username>/mail/<imap foldername>. As the subject states, the
imap folder is about 700MB.
Googling suggested that munpack might do the trick, but as it is
intended only for one message at a time, it outputs the first attachment
found, then exits gracefully.
Further searches seemed to talk about mimedump, so I yum installed
perl-MIME-tools.noarch from rpmforge as mimedump this was needed, and
includes mimedump.
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
Thanks in advance,
-Ray
System runs CentOS 5.1, not updated since April, but it is not connected
to the internet (I do bring it online to install packages as needed); I
will do a complete upgrade before the end of this month.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
07-01-2008, 03:59 PM
Les Mikesell
extract MIME attachments from 700MB imap folder
Ray Leventhal wrote:
Issue:
I've been tasked with extracting a bunch of MIME attachments (M$Word
docs) from emails which have been stored in an imap folder in
/home/<username>/mail/<imap foldername>. As the subject states, the
imap folder is about 700MB.
Googling suggested that munpack might do the trick, but as it is
intended only for one message at a time, it outputs the first attachment
found, then exits gracefully.
Further searches seemed to talk about mimedump, so I yum installed
perl-MIME-tools.noarch from rpmforge as mimedump this was needed, and
includes mimedump.
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:
$archive='/path/to/dir';
my $parser = new MIME::Parser;
### Change how nameless message-component files are named:
$parser->output_dir("$archive");
$parser->output_prefix('msg');
### Parse input:
$entity = $parser->parse(*STDIN) or die "parse failed
";
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.
--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
07-01-2008, 06:09 PM
Ray Leventhal
extract MIME attachments from 700MB imap folder
<snip>
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:
$archive='/path/to/dir';
my $parser = new MIME::Parser;
### Change how nameless message-component files are named:
$parser->output_dir("$archive");
$parser->output_prefix('msg');
### Parse input:
$entity = $parser->parse(*STDIN) or die "parse failed
";
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?
Thanks again,
-Ray
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
07-01-2008, 07:15 PM
Les Mikesell
extract MIME attachments from 700MB imap folder
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:
$archive='/path/to/dir';
my $parser = new MIME::Parser;
### Change how nameless message-component files are named:
$parser->output_dir("$archive");
$parser->output_prefix('msg');
### Parse input:
$entity = $parser->parse(*STDIN) or die "parse failed
";
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: http://search.cpan.org/~doneill/MIME-tools/
--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
07-01-2008, 07:33 PM
Ray Leventhal
extract MIME attachments from 700MB imap folder
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:
$archive='/path/to/dir';
my $parser = new MIME::Parser;
### Change how nameless message-component files are named:
$parser->output_dir("$archive");
$parser->output_prefix('msg');
### Parse input:
$entity = $parser->parse(*STDIN) or die "parse failed
";
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:
http://search.cpan.org/~doneill/MIME-tools/
Thanks, Les. I'm digging into the docs now.
Much obliged,
-Ray
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos