Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MIME::Parser need help

Status
Not open for further replies.

kokopoko

Programmer
Jun 10, 2004
7
US
I've written a script that should parse emails sent to it by the .forward file. Problem is, it's not working. Can anyone tell what's wrong? It doesn't even print out the "got me an email" statement. The .foward file is |directorypath/file.pl.

#!/usr/freeware/bin/perl

use MIME::parser;

my $subject1="Subject: EOS Data Gateway product request";
my $subject2="Subject: ECS Notification";
my $line;
print "got me an email\n";

my $parser=new MIME::parser;
$parser->output_under("/tmp");
$parser->output_prefix("email");
eval {my $entity=$parser->parse(\*STDIN)};
if ($@)
{
$results=$parser->results;
$decapitated=$parser->last_head;
}
 
Look at your error logs. If it's not printing "got me an email" then something is causing the script to hang or abort.

There's always a better way. The fun is trying to find it!
 
try

open(LOG,'>/tmp/forward_pl.log');
print "got me an email\n";
close LOG;


Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top