Package: mailscanner
Version: 4.41.3-2
Severity: important

*** Please type your report below this line ***
Error description
*****************
The (-H) spool file format has changed with Exim version 4.10 --
Debian stable Exim version is 4.50-8 -- and this change is not
reflected in lib/MailScanner/Exim.pm (sub ReadQf). 

If the one_time option is in effect, the corresponding address line
after the non-recipients tree looks like this:

<top-level address> <errors_to address> <length>,<parent number>#<flag
bits>

(see here:
 http://www.exim.org/exim-html-4.50/doc/html/spec_52.html#SECT52.1 )

The Exim.pm code is based on the pre-v4.10 format:

<top-level address> <flags number>,<parent number>,0

This may actually a MailScanner bug not specific to Debian.


Resulting problem
*****************

lib/MailScanner/Exim.pm, sub ReadQf, line 415:

# Add recipient to message data
# but deal with "special" lines first
# (when "one_time" option is being used)
$line =~ s/ \d+,\d+,\d+$//;
push @{$message->{to}}, $line;

The regexp replacement actually does nothing, so that an invalid
"e-mail address" is pushed onto the $message->{to} array if one_time
is in effect; something like:

  "[EMAIL PROTECTED] [EMAIL PROTECTED] 17,1#01"
or
  "[EMAIL PROTECTED]  0,1#01"


Solution suggestion
*******************

Replace the regexp used to strip away the "special" data:

If addresses in spool files were guaranteed not to contain spaces,
then the following would work:

$line =~ s/ *$//;

Unfortunately, RFC2822 seems to suggest that addresses whose local
and domain parts contain spaces must at least be parsed (though I
neither read nor understood this RFC completely).

So here's another suggestion (attached as diff):

# strips old "special" content
$line =~ s/ \d+,\d+,\d+$//;
# strips new "special" content
$line =~ s/ (\d+),\d+#01$//;
if ($1) {
  $line = substr($line, 0, length($line)-$1-1);
}

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.27
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages mailscanner depends on:
ii  debconf                     1.4.30.13    Debian configuration management sy
ii  exim4                       4.50-8       metapackage to ease exim MTA (v4) 
ii  exim4-daemon-light [mail-tr 4.50-8       lightweight exim MTA (v4) daemon
ii  libarchive-zip-perl         1.14-1       Module for manipulation of ZIP arc
ii  libcompress-zlib-perl       1.34-1       Perl module for creation and manip
ii  libconvert-binhex-perl      1.119-2      Perl5 module for extracting data f
ii  libconvert-tnef-perl        0.17-4       Perl module to read TNEF files
ii  libhtml-parser-perl         3.45-2       A collection of modules that parse
ii  libmime-perl                5.417-1      Perl5 modules for MIME-compliant m
ii  libnet-cidr-perl            0.10-1       Manipulate IPv4/IPv6 netblocks in 
ii  ncftp                       2:3.1.8-1    A user-friendly and well-featured 
ii  perl                        5.8.4-8      Larry Wall's Practical Extraction 
ii  spamassassin                3.0.3-2      Perl-based spam filter using text 
ii  ucf                         1.17         Update Configuration File: preserv
ii  unzip                       5.52-1sarge2 De-archiver for .zip files
ii  wget                        1.9.1-12     retrieves files from the web

--- 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 ($1) {
+        $line = substr($line, 0, length($line)-$1-1);
+      }
+
       push @{$message->{to}}, $line;
     }
   }

Reply via email to