File type rulesets

Julian Field MailScanner at ecs.soton.ac.uk
Wed Jun 29 10:41:11 IST 2005


Where you say
Filename Rules = %etc-dir%/filename.rules
I think you mean
Filename Rules = %rules-dir%/filename.rules
and immediately below it I would say "/etc/MailScanner/rules"

START READING HERE

There is actually a way you can make this whole setup neater and  
easier to maintain.

Whenever (in the MailScanner.conf or a *.rules file) you specify the  
name of a "filename.rules.conf" file, you can supply a space- 
separated list of filename.rules.conf files.

The filename allow/deny rules that are applied are the concatenation  
of all the filename.rules.conf files that you have listed.

The allow/deny rule that is used for a particular attachment is the  
first one that matches. It stops processing there and does the allow  
or deny (or deny+delete) that is appropriate.

So you DON'T need to have a filename.rules.conf file that is a copy  
of the supplied one with an extra rule at the top (deny \.zip$ - -).  
If you have a lot of these files this can get very awkward and hard  
to maintain.

All you actually need is one copy of the supplied filename.rules.conf  
file, and 1 file for each modification. In this example we are going  
to block zip files for mail to/from 'domain1.ie'.

MailScanner.conf:
Filename Rules = %rules-dir%/filename.rules

%rules-dir%/filename.rules:
FromOrTo: *@domain1.ie /etc/MailScanner/filename.domain1.ie.conf /etc/ 
MailScanner/filename.rules.conf

*** Here is the difference ***
/etc/MailScanner/filename.domain1.ie.conf:
deny \.zip$ - -

/etc/MailScanner/filename.rules.conf:
Exactly as I supply it

The thing to notice is the the filename.domain1.ie.conf only needs to  
contain 1 line, it does not need to repeat the whole of  
filename.rules.conf.

Cool huh?

On 29 Jun 2005, at 01:23, Michele Neylon:: Blacknight.ie wrote:

> Following on my own issues with rulesets I posted the following:
>
> http://www.mneylon.com/blog/archives/2005/06/29/content-filtering- 
> with-mails
> canner-part-1-file-types/
>
> Any input, corrections etc., are welcome
>
> Michele
>
> Mr Michele Neylon
> Blacknight Internet Solutions Ltd
> Quality Hosting, co-location & domains
> http://www.blacknight.ie/
> Tel. +353 59 9183072
> Tired of your current host? Save 15% when you move to us!
>
> ------------------------ 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!
>
>

-- 
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654

------------------------ 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