I just canīt find any module that filters email headers correctly. I am using Email::Filter now. Maybe Iīm doing something wrong, so here it is. Itīs a little dirty yet, so please donīt mind that:
Email::Filter says this is the body:use Net::POP3; use Email::Filter; my $pop = Net::POP3->new($host); if ($pop->login($user, $pass) > 0) { my $msgnums = $pop->list; # hashref of msgnum => size foreach my $msgnum (keys %$msgnums) { my $msg = $pop->getfh($msgnum); my $message; while (<$msg>) { $message .= $_; } my $mail = Email::Filter->new(data => $message); my $body = $mail->body; print $body; # $pop->delete($msgnum); } } $pop->quit;
Ok, I can strpe out the first block before the \n\n and the last one too. But is this is supposed to work will all mesages? Isnīt there a cleaner way? Also because I will need to treat attachments too, and now I donīt have a clue of how to do that. Maybe this dirty solution doesnīt work with emails carrying attachments.This is a multi-part message in MIME format. ------=_NextPart_000_0025_01C5BE3F.21ECA0A0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hello Just to test! Bye! Andr=E9 ------=_NextPart_000_0025_01C5BE3F.21ECA0A0
Please give me a hand if you can
Thanks
Andre_br
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |