Feature request: Multiple rules for MailScanner variable.

Jim Barber jim.barber at ddihealth.com
Tue Mar 3 08:37:27 GMT 2009

Julian Field wrote:
> On 27/2/09 01:18, Jim Barber wrote:
>> Hi Jules.
>> I have a CustomFunction that checks for users that are using SMTP AUTH.
>> eg:
>>    Spam Checks = &CheckSMTPAuth
>> The above will skip spam checks for anyone that has authenticated to 
>> our mail server.
>> I also have entries in my MailScanner.conf file that refer to rules 
>> files to turn off certain features for trusted networks.
>> eg:
>>    Also Find Numeric Phishing = %rules-dir%/phishing.rules
>> Where the /etc/MailScanner/MailScanner/rules/phishing.rules file will 
>> contain entries like so:
>>    # Local host
>>    From:    no
>>    # Internal subnets
>>    From:       10.          no
>>    From:       192.168.     no
>>    FromOrTo:   default      yes
>> Which handles not doing numeric phishing checks on emails sent by 
>> internal users.
>> However, what if I want to skip numeric phishing checks for both the 
>> networks defined in the rules file and anyone that has authenticated 
>> to the mail server?
>> As far as I can tell, at the moment I'd need to make a new custom 
>> function that does both the SMTP AUTH check, and parses the rule file 
>> (or get a list of networks in any number of other ways).
>> I was wondering if you could add a feature that is something like the 
>> following.
>> Either allow a syntax like:
>>    Also Find Numeric Phishing = %rules-dir%/phishing.rules OR 
>> &CheckSMTPAuth
>> Or being able to specify the same parameter multiple times and have 
>> each one checked.
>> eg:
>>    Also Find Numeric Phishing = %rules-dir%/phishing.rules
>>    Also Find Numeric Phishing = &CheckSMTPAuth
>> I guess the difficulty would be how to handle the "default" rules when 
>> you have multiple checks going on.
>> Maybe just leave it up to the mail administrators to create custom 
>> rule files that don't have a default on the end, except for in the 
>> last one to be referenced... Maybe that would be a pain to support on 
>> these lists though :(
>> Any thoughts?
>> Or is the functionality I am looking for already there and I'm just 
>> missing it?
> You can do it with a Custom Function that also looks at a ruleset. Look in
> /usr/lib/MailScanner/MailScanner/CustomFunctions/Ruleset-from-Function.pm
> and you'll find an example showing you exactly how to do it.
> Jules

Thanks Julian.

I've found the example and will take a look.
For you Debian users, it is under: /usr/share/doc/mailscanner/examples/CustomFunctions/Ruleset-from-Function.pm

Alex, I've replied to you off-list about the CustomFunction with some limitations with mine and suggestions for how to improve it.


Jim Barber
DDI Health

More information about the MailScanner mailing list