Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules

Discuss our MailScanner install script and MailScanner itself
Post Reply
bloatedstoat
Junior Member
Posts: 12
Joined: 11 Jun 2013, 01:22

Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules

Post by bloatedstoat »

Hello,

Just recently had a new server configured by Configserver and decided to go with Mailscanner this time around, never tried it.

Anyway, when restarting Mailscanner the following error is logged to /var/log/maillog and I'd like to fix it.

May 22 15:22:50 ourserver MailScanner[2208903]: Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules

--- snip ---

May 22 15:22:47 ourserver MailScanner[2190667]: Config: calling custom end function MailControlLogging
May 22 15:22:47 ourserver MailScanner[2198019]: Config: calling custom end function MailControlLogging
May 22 15:22:47 ourserver MailScanner[2207389]: Config: calling custom end function MailControlLogging
May 22 15:22:50 ourserver MailScanner[2208903]: MailScanner Email Processor version 5.4.4 starting...
May 22 15:22:50 ourserver MailScanner[2208903]: Reading configuration file /usr/mailscanner/etc/MailScanner.conf
May 22 15:22:50 ourserver MailScanner[2208903]: Reading configuration file /usr/mailscanner/etc/conf.d/README
May 22 15:22:50 ourserver MailScanner[2208903]: Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules
May 22 15:22:50 ourserver MailScanner[2208903]: Found syntax errors in /usr/mailscanner/etc/rules/spam.whitelist.rules.
May 22 15:22:50 ourserver MailScanner[2208903]: Config: calling custom init function MailControlLogging
May 22 15:22:51 ourserver MailScanner[2208903]: Using SpamAssassin results cache
May 22 15:22:51 ourserver MailScanner[2208903]: Connected to SpamAssassin cache database
May 22 15:22:51 ourserver MailScanner[2208903]: Expired 2 records from the SpamAssassin cache
May 22 15:22:52 ourserver MailScanner[2208904]: MailScanner Email Processor version 5.4.4 starting...
May 22 15:22:52 ourserver MailScanner[2208904]: Reading configuration file /usr/mailscanner/etc/MailScanner.conf
May 22 15:22:52 ourserver MailScanner[2208904]: Reading configuration file /usr/mailscanner/etc/conf.d/README
May 22 15:22:52 ourserver MailScanner[2208904]: Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules
May 22 15:22:52 ourserver MailScanner[2208904]: Found syntax errors in /usr/mailscanner/etc/rules/spam.whitelist.rules.
May 22 15:22:52 ourserver MailScanner[2208904]: Config: calling custom init function MailControlLogging
May 22 15:22:53 ourserver MailScanner[2208904]: Using SpamAssassin results cache
May 22 15:22:53 ourserver MailScanner[2208904]: Connected to SpamAssassin cache database
May 22 15:22:54 ourserver MailScanner[2208908]: MailScanner Email Processor version 5.4.4 starting...
May 22 15:22:54 ourserver MailScanner[2208908]: Reading configuration file /usr/mailscanner/etc/MailScanner.conf
May 22 15:22:54 ourserver MailScanner[2208908]: Reading configuration file /usr/mailscanner/etc/conf.d/README
May 22 15:22:54 ourserver MailScanner[2208908]: Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules
May 22 15:22:54 ourserver MailScanner[2208908]: Found syntax errors in /usr/mailscanner/etc/rules/spam.whitelist.rules.
May 22 15:22:54 ourserver MailScanner[2208908]: Config: calling custom init function MailControlLogging
May 22 15:22:55 ourserver MailScanner[2208908]: Using SpamAssassin results cache
May 22 15:22:55 ourserver MailScanner[2208908]: Connected to SpamAssassin cache database
May 22 15:22:56 ourserver MailScanner[2208904]: Using locktype = posix
May 22 15:22:58 ourserver MailScanner[2208908]: Using locktype = posix
May 22 15:22:58 ourserver MailScanner[2208903]: Using locktype = posix

--- snip ---

The first line of the whitelist rules is:
To: *@* and From: yes

How do I fix this please, probs something dead simple but I'm not seeing it.

Thank you.
Sarah
Moderator
Posts: 934
Joined: 09 Dec 2006, 22:49

Re: Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules

Post by Sarah »

There needs to be either an email address or a domain between "From:" and "yes". Usually there is a line whitelisting the postmaster first, then whitelisting server email addresses, like this:

Code: Select all

From:   127.0.0.1 and From: postmaster@server.domain.com       yes # postmaster
To: *@* and From: *@server.domain.com  yes
Try replacing your first line with these two lines (editing for your server's actual hostname) and see if that resolves it.

Regards,

Sarah
configserver.com
bloatedstoat
Junior Member
Posts: 12
Joined: 11 Jun 2013, 01:22

Re: Syntax error in line 1 of ruleset file /usr/mailscanner/etc/rules/spam.whitelist.rules

Post by bloatedstoat »

Hi Sarah,

There needs to be either an email address or a domain between "From:" and "yes".

I have the two lines you mentioned but there was one above those two with no email address, as soon as you mentioned the above it made sense. I've commented that line out and there are no errors on Mailscanner restart.

Thank you!
Post Reply