Hi,
Does anyone know if there is an easy way to "source" a mailscanner .conf file from another? Like for example, if I wanted to include some special rules for a certain group of e-mails/domains - I could just import the changes to the main ruleset.
Currently I have 2 rulesets for filename.rules.conf - they're almost identical except a couple lines. I'd rather not have to explain via comments that these 2 files need to be modified in tandem, except those 2 rules that are different.
Also, offhand - does anyone know if the first rule you hit is what counts - or is it the last. Or is it the first deny you hit that denies you but you have to pass all the rest? I've been using it a few years and still not sure how it works exactly.
Thanks
How to "source" a .conf file
Re: How to "source" a .conf file
That's called "include" and I don't believe it is supported.
Good question! I've wondered this myself. It's easy enough to test. Let's see:
Test 1: adding this to /etc/MailScanner/filename.rules.conf
Code: Select all
allow \.testing$ testing extension allowed test extension to deliver
deny \.test.*$ testing extension denied test extension to not deliver
results:
allowed: mailscanner.testing
denied: mailscanner.test
Test 2: change the order of the instructions
Code: Select all
deny \.test.*$ testing extension denied test extension to not deliver
allow \.testing$ testing extension allowed test extension to deliver
results:
allowed: mailscanner.testing
denied: mailscanner.test
Conclusion:
The order doesn't seem to matter. What seems to matter is how close the match is to what you are testing. Since .testing$ is a more exact match than \.test*$, that rule took priority over the wildcard rule.
Also, I tested with "mailscanner.testin" and it was denied, just as I expected it would be.
Re: How to "source" a .conf file
pdwalker, Thank you for the excellent answer and going thru testing this.
Re: How to "source" a .conf file
You're welcome. It's actually a question I had for myself, but I was previously too lazy to get off my ass and work it out.