Subject: | Problem with non-standard message/delivery-status |
Date: | Wed, 30 Aug 2006 22:16:11 -0500 |
To: | bug-Mail-DeliveryStatus-BounceParser [...] rt.cpan.org |
From: | "Stepan Riha" <nonplus [...] gmail.com> |
I've got a bounced email whose message/delivery-status section has an
extra blank line. I'm not sure why, although it's possible that the
message got munged by "SurfControl E-mail Filter".
This could be fixed on line 338 of BounceParser.pm by stripping
leading "\n" from $para. Instead of
foreach my $para (split /\n\n/, $delivery_status_body) {
my $report = Mail::Header->new([split /\n/, $para]);
use the following:
foreach my $para (split /\n\n/, $delivery_status_body) {
$para =~ s/^\n//;
my $report = Mail::Header->new([split /\n/, $para]);
This shouldn't affect well formed bounces, but would fix the situation
where you have an extra blank line between section.
Here's the relevant section from the bounce message - note the leading
two blank lines following "Content-Type: message/delivery-status;":
----=_NextPart_ST_05_01_24_Wednesday_August_16_2006_16202
Content-Type: message/delivery-status;
Action: failed
Final-Recipient: rfc822; some_user@ccc.edu
Diagnostic-Code: smtp; 554 Service currently unavailable
Status: 5.0.0
----=_NextPart_ST_05_01_24_Wednesday_August_16_2006_16202
Content-Type: message/rfc822;