nasty bug in (I think)

Julian Field mailscanner at
Sat Aug 12 15:03:58 IST 2006

Hash: SHA1

If there had been mis-matching brackets, then
perl -c
would have failed. Remember that Perl compiles all the code before it 
starts running it, it isn't an interpreted scripting language, it's a 
compiled one. So the syntax basically has to be right before it will 
start executing anything (apart from things like eval "" code and stuff 
like that).

Jeff A. Earickson wrote:
> I came to this realization after a good dinner tonight.  Sigh.
> Jeff Earickson
> On Fri, 11 Aug 2006, Logan Shaw wrote:
>> Date: Fri, 11 Aug 2006 17:26:57 -0500 (CDT)
>> From: Logan Shaw <lshaw at>
>> Reply-To: MailScanner discussion <mailscanner at>
>> To: MailScanner discussion <mailscanner at>
>> Subject: Re: nasty bug in (I think)
>> On Fri, 11 Aug 2006, Jeff A. Earickson wrote:
>>> So I stared at  You commented out line 287:
>>> #if (MailScanner::Config::Value('compilespamassassinonce')) {
>>> at some point, which commented out half of a curly-bracket block.
>>> I can't find where the right curly-bracket for this line is, and I
>>> think something is mis-aligned here.
>>> Using the power feature of vi whereby you put the cursor over a
>>> bracket, paren, etc and then hit "%", I don't find the closing curly 
>>> bracket for line 72 ("sub initialise {").  This routine seems
>>> mangled and I think this is the root cause of the loop-up bug.
>> Beware of using "%" in vi on Perl code.  vi's "%" feature was
>> written for C, and as you may have noticed, Perl's syntax is
>> not exactly the same as C's.  :-)  (It is similar enough to make
>> "%" work most of the time, though.)
>> In particular, vi really doesn't understand braces that are
>> commented out with Perl comments:
>>     while (1)
>>     {
>>         bar1();
>>         # this brace will confuse vi ---> }
>>         bar2();
>>     }
>> Try putting your cursor on the "{" right after the "while" and
>> hitting "%".  You'll see it matching against the wrong brace.
>> In fact, I think that's what is happening with  An easy
>> way to test it is to just delete the comment line with the brace
>> that's confusing vi.  We are probably at different MailScanner
>> versions since the corresponding line on mine is at 285, but
>> if you delete the line with 'compilespamassassinonce' on it,
>> then try to match braces with "%", everything looks good.
>>  - Logan
>> -- 
>> MailScanner mailing list
>> mailscanner at
>> Before posting, read
>> Support MailScanner development - buy the book off the website!

- -- 
Julian Field
Buy the MailScanner book at

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Get your PCs and servers from, very well built and reliable!

Version: PGP SDK 3.7.0
Charset: ISO-8859-1


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
For all your IT requirements visit

More information about the MailScanner mailing list