in reply to Playing with attachments

...however, if the original mail file contains an attachment, the attachment is not shown...

And that's why I feel like you're reinventing the wheel. Exactly for this sort of reason, there are modules such as Mail::Box. It will handle those cases for you.

Liz