I would suggest using Email::MIME - you can do something like:
use strict; use warnings; + use Email::MIME; use Email::Folder::Mbox; + my @received; my $box = Email::Folder::Mbox->new('/home/jonathan/mail/spam'); while ( my $mail = $box->next_message ) { my $main = Email::Simple->new($mail); + if ($main->header('Content-Type') and $main->header('Content-Type') + =~ /multipart/i ) { my $mess = Email::MIME->new($mail); + foreach my $part ($mess->parts()) { if ($part->content_type() =~ m%message/rfc822%i ) { print $part->as_string(); } } } + }
/J\
In reply to Re: Parsing a multipart mail
by gellyfish
in thread Parsing a multipart mail
by perl_newbie411
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |