Custom rulesets

Mark Sapiro mark at
Mon Jan 21 18:33:17 UTC 2019

On 1/21/19 10:11 AM, Peter Farrow wrote:
> It says in the MailScanner.conf file for the "tags" disarm settings that
> this can be the name of a ruleset.
> I would like the following settings set to "yes" for a particular
> recipient domain:
> Allow IFrame Tags = disarm
> Allow Script Tags = disarm
> Allow WebBugs = disarm
> Allow Object Codebase Tags = disarm
> Convert Dangerous HTML To Text = yes
> I would like these settings to be all set to set to yes for a particular
> recipient domain (
> I do apologise if there is somewhere  this is documented that I should
> have read but I cannot find any detail on how to name and construct such
> a rule...

Have you read /etc/MailScanner/rules/README and

Maybe your issue is because you need a ruleset for each setting. You
probably inly need two actual rulesets, one for the settings for which
you want 'disarm' settings and one for the setting you want 'yes'. E.g.,

/etc/MailScanner/rules/disarm.rules with content

To: * disarm
FromOrTo: default no

Or if you really meant you want the 'disarm' settings to be 'yes' for
the particular domain and 'disarm' for others

To: * yes
FromOrTo: default disarm

and /etc/MailScanner/rules/yes.rules with content

To: * yes
FromOrTo: default no

Then in your MailScanner.conf or conf.d/... or wherever you put it

Allow IFrame Tags = %rules-dir%/disarm.rules
Allow Script Tags = %rules-dir%/disarm.rules
Allow WebBugs = %rules-dir%/disarm.rules
Allow Object Codebase Tags = %rules-dir%/disarm.rules
Convert Dangerous HTML To Text = %rules-dir%/yes.rules

Mark Sapiro <mark at>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the MailScanner mailing list