Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mail-DeliveryStatus-BounceParser CPAN distribution.

Report information
The Basics
Id: 51506
Status: resolved
Priority: 0/
Queue: Mail-DeliveryStatus-BounceParser

People
Owner: Nobody in particular
Requestors: MSTEVENS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.520
Fixed in: (no value)



Subject: Eliminate warnings when running "make test"
Eliminate warnings when running tests. Also available on github: http://github.com/mstevens/mail-deliverystatus-bounceparser/commit/a16ff151e9fb6bb3930c884678efee6dfa07d74a and pull request sent to rjbs. commit a16ff151e9fb6bb3930c884678efee6dfa07d74a Author: Michael Stevens <mstevens@etla.org> Date: Fri Nov 13 15:55:01 2009 +0000 Eliminate warnings in Mail::Header that were showing when "make test" was run. diff --git a/lib/Mail/DeliveryStatus/BounceParser.pm b/lib/Mail/DeliveryStatus/BounceParser.pm index a288d42..760a9d6 100644 --- a/lib/Mail/DeliveryStatus/BounceParser.pm +++ b/lib/Mail/DeliveryStatus/BounceParser.pm @@ -381,7 +381,10 @@ sub parse { } for my $hdr (qw(Reporting-MTA Arrival-Date)) { - $report->replace($hdr => $global{$hdr} ||= $report->get($hdr)) + my $val = $global{$hdr} ||= $report->get($hdr); + if (defined($val)) { + $report->replace($hdr => $val) + } } my $email; @@ -434,13 +437,15 @@ sub parse { my ($code) = $report->get('diagnostic-code') =~ m/ ( ( [245] \d{2} ) \s | \s ( [245] \d{2} ) (?!\.) ) /x; - $report->replace(smtp_code => $code); + if ($code) { + $report->replace(smtp_code => $code); + } if (not $report->get("host")) { $report->replace(host => ($report->get("email") =~ /\@(.+)/)[0]) } - if ($report->get("smtp_code") =~ /^2../) { + if ($report->get("smtp_code") and ($report->get("smtp_code") =~ /^2../)) { $self->log( "smtp code is " . $report->get("smtp_code")