Zip file Block

Questions and answers about how to do stuff
Post Reply
itr
Posts: 6
Joined: 08 Feb 2016 15:37

Zip file Block

Post by itr »

Hi,

im using

Deny Filenames = \.zip$ in the Mailscanner.conf for blocking all zip files.
But is it possible to block all zip files except the files starting with (for example): ITR_*.zip?

Thank you
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Zip file Block

Post by shawniverson »

That's a tough one.

You don't want to block basically "ITR_*\.zip$", so if you inverse that it with allow everything else (including zips).

So, you will need to use the rulesets instead.

How about this?

/etc/MailScanner/filename.rules.conf (use tabs between not spaces)

Code: Select all

allow	ITR_*\.zip$	Allow zips with ITR Prefix	Allow zips with ITR Prefix
#allow	\.zip$	-	-
deny	\.zip$	Deny zips	Deny zips
itr
Posts: 6
Joined: 08 Feb 2016 15:37

Re: Zip file Block

Post by itr »

Hi,

thank you for the answer.

Its now blocking the zip files with the new "Deny zips" message, but when sending it with prefix ITR_Test.zip its also blocked via the "Deny zips" rule.
Is the deny rule "higher" then the allow rule?

Got another idea? ;)

Thank you!
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Zip file Block

Post by shawniverson »

Dang, block overrides allow...

What about this?

Code: Select all

deny	(?!ITR_)\.zip$	Deny zips	Deny zips except for those with ITR prefix
itr
Posts: 6
Joined: 08 Feb 2016 15:37

Re: Zip file Block

Post by itr »

Hi,

mhm comes up with the new error message "Deny zips except for those with ITR prefix" but it is blocking files like "ITR_523.zip"

Thank you
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Zip file Block

Post by shawniverson »

Forgot a wildcard...try this....

Code: Select all

deny   (?!ITR_).*\.zip$   Deny zips   Deny zips except for those with ITR prefix
itr
Posts: 6
Joined: 08 Feb 2016 15:37

Re: Zip file Block

Post by itr »

Hi,

mhm the same "problem" it blocks all zip files :(

Thx
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Zip file Block

Post by shawniverson »

Code: Select all

deny   ^(?!ITR_).*\.zip$   Deny zips   Deny zips except for those with ITR prefix
itr
Posts: 6
Joined: 08 Feb 2016 15:37

Re: Zip file Block

Post by itr »

Hi,

thank you very much, this is working :)

Thank you!
itr
Posts: 6
Joined: 08 Feb 2016 15:37

Re: Zip file Block

Post by itr »

Hi,

another question ;)

is it possible to notify the sender AND the receiver that a zip was blocked? Also is there an option to just set *.zip to a score that it gets blocked and could be released via the Link that is sent from EFA3?

Thx
Post Reply