Is there exists reliable email parser for perl?

CPAN module, or separate perl script, or some standard unix command line util which can be used from perl script is acceptable.

Word reliable in my question mean:

I know about huge amount of CPAN modules for MIME/822headers parsing... I've checked them all few months ago without success. Simple and small modules developed without RFC compliance, other few HUGE bundles containing too much complex OO code to be "defect free" and to give me a chance to check them for RFC compliance. :(

Here is example interface which show email parsing result I need:

# $mime_info = mime_unpack($mime); # $mime_info = { # Subject => $subject, # Date => $date, # From => $from, # Reply_to => $reply_to, # To => \@to, # Cc => \@cc, # encrypted => $true, # signed_by => { $gpgid1 => $true, $gpgid2 => $true }, # headers => "From: ...\nTo: ...\n...\n", # type => "multipart/mixed", # body => [ # { # headers => "...", # type => "multipart/related", # body => [ # { # headers => "...", # type => "multipart/alternative", # body => [ # { # headers => "...", # type => "text/plain", # charset => "koi8-r", # body => "...", # }, # { # headers => "...", # type => "text/html", # charset => "koi8-r", # body => "...", # }, # ], # }, # { # headers => "...", # type => "image/gif", # name => 722370018427e0cb56ef03.gif", # cid => "000a01c69f03$d48fa5e0$0202a8c0@m" # body => "...", # }, # ], # }, # { # headers => "...", # type => "image/jpeg", # filename => "_devochka.jpeg", # body => "...", # }, # ], # } # die "message must be encrypted" if !$email_info->{gpg}{encrypted}; # die "message must by signed by authorized developer" # if !$email_info->{gpg}{signed_by}{ $fingerprint{powerman} } # && !$email_info->{gpg}{signed_by}{ $fingerprint{nikita} } # ;

In reply to Reliable email parsing by powerman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.