How I create the correct rule to block some attachments

nick

Renowned Member
Mar 28, 2007
364
1
83
Hi all,

I realy need to know how to create the correct rule to block some extensions types (ex: *.abc and *.xyz).

What I do:

1) I go in "What" section and I add a new What Object called: Blocked_Extensions
2) I Edit the object and I add a new ContentType Object.
Choose ContentType: application/.*
ContentType: .abc, .xyz

3) I save the object and I go in rule and I add new rule; On action I add:
Block; Notify Admin; Quarantine

What I do wrong because some mail are passed trough this filter.

I use proxmox-mailgateway/2.2/3705
 
2) I Edit the object and I add a new ContentType Object.
Choose ContentType: application/.*
ContentType: .abc, .xyz

ContentType objects match against the MIME content type, and not against file names.

Please use a 'MatchFilename' object instead. To match above extensions use the following value (regular expression):

Code:
.*\.(abc|xyz)
 
If I give a test I receive this error:

Test doesn't match!

I create for example: .*\.(exe|cab|lnk|mp3|wav|pps|avi|mpg|mpeg)
 
OK, It's correct now! I Put the filter in test field and that's why I receive the error! Now I create the correct rule and it's working!

Thank you!
 
Note: Using file extensions is not always accurate. Its better to use the ContentType filter because that filter analyzes the files to see what it really contains (mime type detector).
 
And how I create a content type rule correct for extensions write in example?
 
You need to create several content type objects (one for each type you want to match).

Simply tahe a look at the default 'What' objects to see how it works.

- Dietmar
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!