I use MIME::Parser, it works quite well even with malicious e-mails.
Alexander
In reply to Re: Robust parsing of email messages by afoken in thread Robust parsing of email messages by downer