Setting up Black & Whitelists by domain

Julian Field mailscanner at ecs.soton.ac.uk
Sun Jan 12 15:35:59 GMT 2003


At 14:55 12/01/2003, you wrote:
> > The problem we have is that everytime we add to
> /opt/rules/blacklist.rules the following:
>
> > FromTo: default    no
> > To: *@sme-ecom.co.uk    /opt/bydomain/sme-ecom.co.uk/blacklist.rules
>
> > we get a syntax error in our logs as shown here:
>
> > "Syntax error in line 2 of ruleset file /opt/rules/spam.blacklist.rules
> for keyword
> >   spamblacklist
> >  Jan 12 14:02:21 cobaltxxxx MailScanner[3589]: Aborting due to syntax
> errors in
> > /opt/rules/spam.blacklist.rules.
>
> >  The same happens when we try to set the Whitelist rules.
>
> >  Could anyone guide us or point out the errors of our ways - can this
> be done?
>
>You are trying to specify a ruleset as the result of a ruleset, whereas
>you should only specify a yes or no (or whatever the legal values are for
>that option in the config file).
>
>I don't know any easy way of achieving what you want to do, if its no
>possible to combine all the rules you want into a single ruleset.  If you
>are running a version of MS since 4.03 and you know some perl you could
>get your hands dirty and write a custom function in
>CustomConfig.pm to handle this (see the top of the config file for details
>about how to call this function).  I imagine it would be possible to
>achieve what you want like that.

Just to confirm that you are quite right. I haven't yet come up with a way
of having rulesets within rulesets, which is what this would need.

Currently you will have to write some custom function to do it for you.
Shouldn't be too hard to do, especially if it's only a simple (but possibly
long) ruleset for each domain. If each black/white-listed address is either
a complete address or a domain name (so no "*" characters anywhere), then
the end result will be very fast too.

Thinking further, we have a dir "/opt/bydomain" which contains 2
subdirectories, "blacklist" and "whitelist".
Each of those directories contains a file named after each domain. So for
"example.com" there will be /opt/bydomain/whitelist/example.com and
/opt/bydomain/blacklist/example.com.
Each of the example.com files can contain entries of the form
         user at address.spam.com
and
         address.spam.com
and that's all. Keeping it restricted to this makes life a lot easier later.

I'll get back to the list shortly about this, it's probably worth me
writing an implementation of this as it is going to be a common requirement.

For a sample domain "example.com", there is a file "example.com.white" and
"example.com.black".
--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support



More information about the MailScanner mailing list