setup filetype and filename rules per domain

Kevin Miller Kevin_Miller at
Mon Aug 7 18:13:05 IST 2006

Julian Field wrote:

> In recent versions (version 4.49 and onwards) there are some new
> configuration settings,
> 	Allow Filenames
> 	Deny Filenames
> 	Allow Filetypes
> 	Deny Filetypes
> These are not as flexible as the filename.rules.conf and
> filetype.rules.conf files, but you may find them easier to use and
> good enough for your requirements.
> For an example, let's say that domain wants to be able to
> email files called "*.mp3" and "*.wav". You would still need to do
> similar setups to stop the "filetype.rules.conf" file trapping movies
> in general. But let's keep it simple for this example.
> 1) We need to tell MailScanner to create a ruleset for "Allow
> Filenames" so we can vary the value of this setting depending on
> where the mail is going to.
> In MailScanner.conf, set
> Allow Filenames = %rules-dir%/allow.filenames.rules
> 2) Create the ruleset. This just needs to allow *.mp3 and *.wav for
> mail going to anyone at
> In /etc/MailScanner/rules/allow.filenames.rules, put
> To: \.mov$ \.mp3$
> Note that the text to the right of "" is a space-separated list
> of regular expressions. You need to put the "\" before the "." as
> otherwise "." would just match any character, not just the actual
> "full stop" character. "$" matches the "end of line", ensuring that
> the ".mov" appears at the end of the filename.

Thanks for the quickie tutorial Julian.  Just a simple sanity check:  I
presume that in allow.filenames.rules that we can use the From: or
FromOrTo: nomenclature as well as the To: tag?

Are tab seperators required between operators?


Kevin Miller                Registered Linux User No: 307357
CBJ MIS Dept.               Network Systems Admin., Mail Admin.
155 South Seward Street     ph: (907) 586-0242
Juneau, Alaska 99801        fax: (907 586-4500

More information about the MailScanner mailing list