Mail-DeliveryStatus-BounceParser - Re: Mail::DeliveryStatus::BounceParser Anybody?

Posted on Mon Mar 7 15:51:06 2005 by b10m in response to 185 (See the whole thread of 3)
Re: Mail::DeliveryStatus::BounceParser Anybody?

Hi,

I've recently started to mess with this module too and found out that it didn't parse _all_ bounces well, but a fair enough deal for what I like to use it for.

I somehow wonder why your 'file size' seems to limit you to read the entire message. Bounces rarely get very big. If you want to parse an entire mailbox, I suggest using e.g. Mail::Box for that part, who throws the individual messages to this module. Maybe you could explain this?

Anyways, this sample code seemed to work for me (basically straight from the POD):

use Mail::DeliveryStatus::BounceParser; my $bounce = eval { Mail::DeliveryStatus::BounceParser->new ( \*STDIN ) }; if ( $@ ) { print "Whoa -- one we actually couldn't handle!\n" ; exit 255 ; } if($bounce->is_bounce) { foreach my $report ( $bounce->reports ) { print $bounce->orig_message_id; print $report->get('std_reason')."\n"; } } else { print "NO BOUNCE!\n"; }

And then,
perl whatever.pl < bounce.message

Direct Responses: 189 | Write a response