Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Robust parsing of email messages

by downer (Monk)
on Mar 25, 2009 at 15:28 UTC ( [id://753156]=note: print w/replies, xml ) Need Help??


in reply to Re: Robust parsing of email messages
in thread Robust parsing of email messages

This is actually quite a difficult task, much harder than i had anticipated. I have been playing with the following code which produces some weird behavior:
!/usr/bin/perl #use Email::MIME; use Email::Simple; use Data::Dumper; use MIME::Parser; use HTML::SimpleParse; use strict; use warnings; undef $/; my $message = <>; my $email = Email::Simple->new($message); print $email->header("To"),"\t",$email->header('Content-Type'), "\n"; my $parser = new MIME::Parser; my $data = $parser->parse($email->body); my $results = $parser->results; print Dumper($results);
I dont know how to handle messages cases where messages are mime/not mime. Plus this doesnt actually seem to "parse" the message. The MIME metadata still is still within the email. suggestions? Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://753156]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-30 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found