File type rulesets

Brad Beckenhauer brad at BECKENHAUER.COM
Wed Jun 29 14:33:02 IST 2005


    [ The following text is in the "iso-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

Very cool!

as Martin said:  
"just spent a few mins getting my head around this..."

Can we use "variable substitution" as shown below?  My thought was that this would shorten "the line".

Example:

filename.rules
# set the variable to point to the default filename.rules.conf file
%def-file-rules% = %etc-dir%/filename.rules.conf

# Direction         Pattern            Ruleset to use
# -------------------------------------------------
FromOrTo:  *@domainA.com    %rules-dir%/filename.domainA.rules.conf    %def-file-rules%
#
FromOrTo:  john at doe.com       %rules-dir%/filename.doe.com.rules.conf    %def-file-rules%
#
FromOrTo:     default                 %etc-dir%/filename.rules.conf


Brad


>>> Julian Field<MailScanner at ECS.SOTON.AC.UK> 6/29/2005 7:41:11 AM >>>
On 29 Jun 2005, at 12:30, Martin Hepworth wrote:

> Julian
>
> just spend a few mins getting my head around this...
>
> OK this is quite nicely put, can this go in the wiki maybe with a  
> full example rather than the partial you provided.

How about you add it and mail me the URL and I will check it for you.  
That you you can see if you really understand it, by you adding the  
extra bits yourself. I will then just correct anthing that's wrong.

> I presume the followind would be correct...
>
> %rules-dir%/filename.rules:
> FromOrTo: *@domain1.ie /etc/MailScanner/filename.domain1.ie.conf / 
> etc/MailScanner/filename.rules.conf
> FromOrTo: default /etc/MailScanner/filename.rules.conf

Correct.

> Julian Field wrote:
>
>> No replies to this yet, did I scare everyone off? :-)
>> On 29 Jun 2005, at 10:41, Julian Field wrote:
>>
>>> 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
>>>>

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

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