my $entity = $parser->parse_data(join '', @{$server->get($i)});
And write that to a file and try to find out whether the attachment payload is malformed or whether there are two attachments with the same suggested output filename etc.
If you suspect that the output file is overwritten, consider running your program under truss or strace to find the API calls that are made. Also consider looking at MIME::Parser::Filer to avoid using (or at least output) the filenames that come in the mail and give your own filenames if you suspect overwriting going on.
Maybe you can also remove most of the base64 encoded payload (if it has been proven to be valid) and replace it by something much smaller that you can post here so we can try to reproduce your problem.
|