MailScanner stoped working after PERL upgrade (I think so)

Julian Field MailScanner at ecs.soton.ac.uk
Tue Dec 6 10:44:49 GMT 2005


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

-----BEGIN PGP SIGNED MESSAGE-----

On 6 Dec 2005, at 08:44, Boris Jordanov / Ð^ÑоÑ^ÀиÑ^Á Ð^ÙоÑ^Àданов  
wrote:
> Julian Field wrote:
>> Something is very wrong with your system. Here's what I get with your
>> message:
>>
>
> Julian, I've managed to work it out (for the proof of my idea only)
>
> Here is the code, it's not a diff, because it is an ugly PoC. The
> problem _is_ in the splitting. I split it my way (again, I'm not into
> PERL, excuse my code) and it is OK. One problem - you are looking for
> something referenced as $5. With the original code and my split MS  
> says
> - corrupted and moves the message to the corrupted directory. If I  
> force:
> $message->{PostfixQmgrOpts} = $5+0;
>
> everything goes OK and the message is delivered.
>
> Can you fix it guys? Please? :) TIA

How about this:

     # Provides Message content size, data offset and recipient count
     ($rectype, $recdata) = ReadRecord($RQf);
     #print "1st $rectype is \"$recdata\"\n";
     MailScanner::Log::WarnLog("Syntax error in Postfix queue file,  
didn't " .
                               "start with a C record") unless  
$rectype eq 'C';
     #$recdata =~ /^([0-9 ]{15}) ([0-9 ]{15}) ([0-9 ]{15})( ([0-9 ] 
{15}))?$/;
     #($MsgContSize, $DataOffset, $NumRecips) = ($1+0, $2+0, $3+0);

     my @numbers = split " ", $recdata;
     ($MsgContSize, $DataOffset, $NumRecips) =
       ($numbers[0]+0, $numbers[1]+0, $numbers[2]+0);

     # If $5 is set then we have a new data structure in the file
     $MailScanner::Postfix::DataStructure = 0;
     #if ($5 ne "") {
     #  $MailScanner::Postfix::DataStructure = 1;
     #  $message->{PostfixQmgrOpts} = $5+0;
     #}

     if (defined $numbers[3]) {
       $MailScanner::Postfix::DataStructure = 1;
       $message->{PostfixQmgrOpts} = $numbers[3]+0;
     }

     #$MsgContSize =~ s/^\s*//;
     #$DataOffset  =~ s/^\s*//;
     #$NumRecips   =~ s/^\s*//;
     #print STDERR "MsgContSize=$MsgContSize DataOffset=$DataOffset  
NumRecips=$NumRecips\n";
     push @{$message->{metadata}}, "$rectype$recdata";

That works okay for me. Please give it a try.
- -- 
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.3 (Build 2932)

iQEVAwUBQ5Vro/w32o+k+q+hAQHRJgf+Pdxrl2VABjOs7eeisIK+wPQXkpqD6Evd
LbX/E9Dpsw7ZZIK9qTMwz+mHz7kii8WNT1n/0pMPFYxVeOSlIME5aFoLEGovMLb6
S13g+VtNibGHROyjVlQyH/cjVfpD+VlYCS1DQhFarYOFaF9Z60RHT5WXeZK11Men
CaVywJmsshB4MKuuou/q7nI5CLS4nGGeH98aBHg7vD88kCoS2L1VpDn/lIXtPNwz
9oc1HwVdkFLvWerDE2UJY3cYsw3AaYaUtdKgGOpXZFelR6UMTi8RE8tvI+19mYqB
jYVPoZLsmuiL3XviRNy/XcGOkBQz9lJbpWUl13fmCuPd6QeM7634Gg==
=hl7p
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

------------------------ 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 Wiki (http://wiki.mailscanner.info/) 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