Syntax error in rule file.

Jim Holland mailscanner at mango.zw
Tue May 2 19:40:12 IST 2006


On Tue, 2 May 2006, Ricardo Aguiar wrote:

> I just upgraded from version '4.51.6' to '4.53.6' and I'm using a rule file to control filenames per domain.
> 
> After running "MailScanner -lint" with the new version installed I get:
> 
> Syntax error in line 1 of ruleset file /etc/MailScanner/filename.rules.rules at /usr/lib/MailScanner/MailScanner/Config.pm line 2265
> Syntax error in line 2 of ruleset file /etc/MailScanner/filename.rules.rules at /usr/lib/MailScanner/MailScanner/Config.pm line 2265
> Found syntax errors in /etc/MailScanner/filename.rules.rules. at /usr/lib/MailScanner/MailScanner/Config.pm line 2120
> Read 717 hostnames from the phishing whitelist
> Checking for SpamAssassin errors (if you use it)...
> Using SpamAssassin results cache
> Connected to SpamAssassin cache database
> SpamAssassin reported no errors.
> 
> 
> ### filename.rules.rules ###
> FromOrTo:       domain.com      /etc/MailScanner/filename.no.rules.conf
> FromOrTo:       default         /etc/MailScanner/filename.rules.conf
> 
> 
> This file is unchanged and work perfectly with version '4.51.6'.

I would start with the MailScanner.conf file:

	What is the "Filename Rules" line?
	The default is: Filename Rules = %etc-dir%/filename.rules.conf

If you are using a ruleset for this, then the logical entry would be:

	Filename Rules = %rules-dir%/filename.rules

However your ruleset filename is filename.rules.rules, in which case the 
corresponding line should be:

	Filename Rules = %rules-dir%/filename.rules.rules

and the above file should be located in say /etc/MailScanner/rules.  
However your error message refers to:

	syntax errors in /etc/MailScanner/filename.rules.rules

which means that you are referring to a ruleset file that is in your 
configuration directory rather than a separate rules directory.  This can 
lead to confusion - I would recommend putting ruleset files in the default 
/etc/MailScanner/rules directory.  You may find that you have files with 
the same name in two different locations, so causing more confusion.

I would also recommend sticking to using the standard variables:

	%etc-dir%
and
	%rules-dir%

in your config and rules files, instead of listing the full path.  That 
way it should be more obvious when a mistake has been made in putting a 
ruleset file in the config directory or vice versa.

Check that all the above makes sense and that you are referring to the 
correct files throughout.  I suspect that that is where your error lies.

Regards

Jim Holland
System Administrator
MANGO - Zimbabwe's non-profit e-mail service



More information about the MailScanner mailing list