setup filetype and filename rules per domain
Julian Field
mailscanner at ecs.soton.ac.uk
Mon Aug 7 18:54:43 IST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Kevin Miller wrote:
> 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 xyz.com 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 xyz.com.
>> In /etc/MailScanner/rules/allow.filenames.rules, put
>> To: xyz.com \.mov$ \.mp3$
>>
>> Note that the text to the right of "xyz.com" 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?
Yes.
>
> Are tab seperators required between operators?
No.
One of the main features that the filename.rules.conf file provides that
is better than the method above, is that the matching regular
expressions can include spaces, which the method above cannot.
- --
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
MailScanner customisation, or any advanced system administration help?
Contact me at Jules at MailScanner.biz
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Get your PCs and servers from Transtec.de, very well built and reliable!
-----BEGIN PGP SIGNATURE-----
Version: PGP SDK 3.7.0
Charset: ISO-8859-1
wj8DBQFE135pEfZZRxQVtlQRAvv4AJ9rr2DZLa6scIatzfHeIEVEhJtRlQCdHT3M
SQiddMN+gfTozUTHKK4hF1o=
=oziO
-----END PGP SIGNATURE-----
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
More information about the MailScanner
mailing list