Problem with MailScanner, postfix and corrupt mails

Julian Field MailScanner at ecs.soton.ac.uk
Wed Mar 16 12:14:44 GMT 2005


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

Robert Waldner wrote:

>On Wed, 16 Mar 2005 07:14:08 +0100, Robert Waldner writes:
>
>
>><patch>
>>
>>
>>>So there are just those 2 "+"-marked lines to add.
>>>If this doesn't fix it, then it really is beyond my control. I'm forcing
>>>it to flush the buffers absolutely everywhere, none of this should be
>>>needed.
>>>
>>>
>
>
>
>>Thanks. I'll apply the patch as soon as I get to work.
>>
>>
>
>Didn't help, another mail just got corrupted.
>
>A question for the others who see this problem: is one you having this
> with perl 5.*6*, or are you all on 5.8? When the problem started here
> in August (didn't notice until shortly ago), it just /might/ have been
> the same time as the 5.6 -> 5.8 upgrade.
>If it's only affecting 5.8 I'll invest half a day to rebuild a machine
> with 5.6 to see if it helps any.
>
>
I have just changed the code a bit, in case Perl was mis-parsing it.

---SNIP---
--- Postfix.pm.old 2005-03-15 19:03:33.000000000 +0000
+++ Postfix.pm  2005-03-16 12:12:45.844918032 +0000
@@ -881,6 +881,7 @@
     #print STDERR "In PreDataString\n";
     # Output all the metadata records up until (& including) the M record.
     $linenum = 0;
+    $result  = '';
     foreach (@{$message->{metadata}}) {
       /^(.)(.*)$/;
       ($type, $data) = ($1, $2);
@@ -917,10 +918,11 @@
     # Store the length of th estring so far as we need to return it
     $preNlen = length($result);

+    my $totallines = scalar(@{$message->{metadata}});
     # Add the headers
-    foreach(; $linenum<@{$message->{metadata}}; $linenum++) {
-      $_ = $message->{metadata}[$linenum];
-      /^(.)(.*)$/;
+    for ($linenum=$linenum; $linenum<$totallines; $linenum++) {
+      #$_ = $message->{metadata}[$linenum];
+      $message->{metadata}[$linenum] =~ /^(.)(.*)$/;
       ($type, $data) = ($1, $2);
       #print STDERR "PreData2 Type $type Data $data\n";
       last if $type eq 'X';
---SNIP---

--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support
Buy the MailScanner book at www.MailScanner.info/store

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!




More information about the MailScanner mailing list