The part
$line =~ s/ (\d+),\d+#01//;
if ($1) {
$line = substr($line, 0, length($line)-$1-1);
}
should actually be:
$line =~ s/ (\d+),\d+#01//;
if (defined $1) {
$line = substr($line, 0, length($line)-$1-1);
}
Otherwise length 0 for errors_to address is not handled correctly.
--- mailscanner-4.41.3.orig/lib/MailScanner/Exim.pm 2005-03-27
19:37:10.000000000 +0200
+++ mailscanner-4.41.3.corrected/lib/MailScanner/Exim.pm 2006-01-06
13:48:33.000000000 +0100
@@ -415,7 +415,15 @@
# Add recipient to message data
# but deal with "special" lines first
# (when "one_time" option is being used)
+
+ # strips old "special" content (< v4.10)
$line =~ s/ \d+,\d+,\d+$//;
+ # strips new "special" content (>= v4.10)
+ $line =~ s/ (\d+),\d+#01$//;
+ if (defined $1) {
+ $line = substr($line, 0, length($line)-$1-1);
+ }
+
push @{$message->{to}}, $line;
}
}