http://qs1969.pair.com?node_id=1180329


in reply to Re^3: MIME::Tools to save attachment properly
in thread MIME::Tools to save attachment properly

I checked the $entity data through Dump::Data, and looks like an actual email. I did find that
my $bh = $part->bodyhandle; print "MIME Type: $type\n";
will outputs all the parts.

But

my $bh = $part->bodyhandle; print "MIME Type: $type\n"; if (defined $bh) { open(my $OUTFILE, ">", $bh->path) or die $!; binmode($OUTFILE); $bh->print(\$OUTFILE); close($OUTFILE); } #End IF $bh defined
the $bh-print, seems to 'overwrite' the attachments making them zero-length.

So I removed that part and my code works. I do need to look at MIME::Parser::Filer more to clean up my code.

I do appreciate everyone's input and this wonderful site.