MailScanner stoped working after PERL upgrade (I think so)
[UTF-8] Boris Jordanov / ÐоÑÐ¸Ñ ÐоÑданов
boris.jordanov at GMAIL.COM
Tue Dec 6 07:55:36 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. ]
Julian Field wrote:
> Something is very wrong with your system. Here's what I get with your
> message:
>
> MsgContSize=635 DataOffset=346 NumRecips=1
> Content size = 635
> Data offset = 346
> Num Recips = 1
>
> which looks fine to me.
>
I've touched the code:
# Read the initial record.
# 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}))?$/;
print "recdata is now \"$recdata\"\n";
($MsgContSize, $DataOffset, $NumRecips) = ($1+0, $2+0, $3+0);
print STDERR "MsgContSize=$MsgContSize DataOffset=$DataOffset
NumRecips=$NumRecips\n";
# 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;
}
$MsgContSize =~ s/^\s*//;
$DataOffset =~ s/^\s*//;
$NumRecips =~ s/^\s*//;
print STDERR "MsgContSize=$MsgContSize DataOffset=$DataOffset
NumRecips=$NumRecips\n";
push @{$message->{metadata}}, "$rectype$recdata";
print STDERR "Content size = $MsgContSize\n";
print STDERR "Data offset = $DataOffset\n";
print STDERR "Num Recips = $NumRecips\n";
# If the data offset is 0 then Postfix definitely hasn't finished
# writing the message.
unless ($DataOffset+0 > 10) { # 10 == arbitrary small number
$message->DropFromBatch();
return 0;
}
And here's the result:
[root at im ~]# MailScanner
In Debugging mode, not forking...
In ReadQf
hdpath = /var/spool/postfix/hold/459D616FBD
inhdhandle = FileHandle=GLOB(0xac65e98)
size = 985
1st C is " 635 346 1 0"
recdata is now " 635 346 1
0"
MsgContSize=459 DataOffset=0 NumRecips=0
MsgContSize=459 DataOffset=0 NumRecips=0
Content size = 459
Data offset = 0
Num Recips = 0
Can't call method "DropFromBatch" on unblessed reference at
/usr/lib/MailScanner/MailScanner/Postfix.pm line 334.
It looks OK _until_
($MsgContSize, $DataOffset, $NumRecips) = ($1+0, $2+0, $3+0);
after that line print STDERR "MsgContSize=$MsgContSize
DataOffset=$DataOffset NumRecips=$NumRecips\n"; returns:
MsgContSize=459 DataOffset=0 NumRecips=0
I'm not into PERL so what's wrong here?:
$recdata =~ /^([0-9 ]{15}) ([0-9 ]{15}) ([0-9 ]{15})( ([0-9 ]{15}))?$/;
I believe the ($MsgContSize, $DataOffset, $NumRecips) = ($1+0, $2+0,
$3+0); line is OK, so I blame $recdata =~ /^([0-9 ]{15}) ([0-9 ]{15})
([0-9 ]{15})( ([0-9 ]{15}))?$/;
------------------------ 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