ultranerds has asked for the wisdom of the Perl Monks concerning the following question:
sub process_mail { my $mesage_body = $_[0]; # Create a new MIME::Parser object my $parser = new MIME::Parser; # Tolerant mode $parser->ignore_errors(1); # Output to a file $parser->output_to_core(0); # Output to a per message folder $parser->output_under("/kunden/217787_60385/onexma/archiv/Clients/ +000000"); # Parsing the message my $entity = $parser->parse_data($_[0]); my $error = ($@ || $parser->last_error); if ($error) { print $error."<br>\n"; } else { print "Attachment extracted !<br>\n"; } # Delete the files containing the message content (we want only th +e attachment) chdir ("."); unlink $entity->{'ME_Parts'}[0]->{'ME_Bodyhandle'}->{'MB_Path'} || + warn ("Can't delete the message body file !"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME::Parser- get the filename + folder it was extracted to?
by roboticus (Chancellor) on Dec 09, 2010 at 13:02 UTC | |
by ultranerds (Hermit) on Dec 09, 2010 at 14:02 UTC |