Subject: | fix strict warning |
Here is small diff which fixes warnings if this module is used under strict warning rules.
--- BounceParser.pm.orig 2005-05-17 20:59:52.810538216 +0200
+++ BounceParser.pm 2005-05-17 21:04:03.663402784 +0200
@@ -479,7 +479,8 @@
# they usually say "returned message" somewhere, and we can split on that, above and below.
- if ($message->bodyhandle->as_string =~ $Returned_Message_Below) {
+ my $body = $message->bodyhandle->as_string;
+ if ($body && $body =~ $Returned_Message_Below) {
my ($stuff_before, $stuff_splitted, $stuff_after) =
split $Returned_Message_Below, $message->bodyhandle->as_string, 3;
# $self->log("splitting on \"$stuff_splitted\", " . length($stuff_before) . " vs " . length($stuff_after) . " bytes.") if $DEBUG > 3;
@@ -965,7 +966,8 @@
#
#
- return unless $message->head->get("X-Mailer") =~ /Internet Mail Service/i;
+ my $x_mailer = $message->head->get("X-Mailer") || return;
+ return unless $x_mailer =~ /Internet Mail Service/i;
if ($message->is_multipart){
return unless my ($error_part) = grep { $_->effective_type eq "text/plain" } $message->parts;
@@ -1034,7 +1036,8 @@
# theetopdog
#
- return unless $message->head->get("Mailer") =~ /AirMail/i;
+ my $mailer = $message->head->get("Mailer") || return;
+ return unless $mailer =~ /AirMail/i;
return unless $message->effective_type eq "text/plain";
return unless $message->bodyhandle->as_string =~ /Your mail to the following recipients could not be delivered because they are not accepting mail from/i;
@@ -1085,7 +1088,8 @@
# Content-Type: message/rfc822
#
- return unless $message->head->get("X-Mailer") =~ /Novell Groupwise/i;
+ my $x_mailer = $message->head->get("X-Mailer") || return;
+ return unless $x_mailer =~ /Novell Groupwise/i;
return unless $message->effective_type eq "multipart/mixed";
return unless my ($error_part) = grep { $_->effective_type eq "text/plain" } $message->parts;