Subject: | fuzzy processing for end of mbox |
mbp root # diff -C 10 /opt/local/lib/perl5/site_perl/5.8.8/Email/Folder/Mbox.pm.orig
/opt/local/lib/perl5/site_perl/5.8.8/Email/Folder/Mbox.pm
*** /opt/local/lib/perl5/site_perl/5.8.8/Email/Folder/Mbox.pm.orig 2008-01-23
15:25:35.000000000 +0900
--- /opt/local/lib/perl5/site_perl/5.8.8/Email/Folder/Mbox.pm 2008-01-23
16:22:11.000000000 +0900
***************
*** 185,204 ****
--- 185,213 ----
/^From (?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)/
);
}
else {
# though, as jwz rants, only this is reliable and portable
last if $prev eq $/ && /^From /;
}
$mail .= $prev;
$prev = $_;
}
+ if ($prev !~ m/^\n$/) {
+ # http://www.ietf.org/rfc/rfc4155.txt
+ # Each message in the database MUST be terminated by an empty
+ # line, containing a single end-of-line marker.
+ #
+ # fuzzy processing for mbox where hasn't terminated by an empty line
+ # for such mbox constructed by Email::LocalDelivery::Mbox. :)
+ $mail .= $prev;
+ }
print "$count end of message line $.\n" if debug;
return unless $mail;
return $mail;
}
sub tell {
my $self = shift;
return tell $self->{_fh};
}
mbp root #