Re: [exim] Trying to block all WAN sent zip emails

Góra strony
Delete this message
Reply to this message
Autor: Renaud Allard
Data:  
Dla: Brent Clark
CC: exim-users
Temat: Re: [exim] Trying to block all WAN sent zip emails
Hi,

Brent Clark wrote:
> Hi all
>
> Im trying to get it that I block all zip files, but users in my LAN can
> send zip files. Ive tried the following, but yet if I send from my gmail
> account, the zip file gets accepted.
>
> deny message = This message contains a prohibited file extension 
> (${extract{-1}{.}{${lc:$mime_filename}}})
> hosts = !+relay_from_hosts :
> #!hosts = 192.168.111.0/24
> log_message = BAD_ATTACHMENT (${extract{-1}{.}{${lc:$mime_filename}}})
> condition = ${if match{${extract{-1}{.}{${lc:$mime_filename}}}}{\N^( \
>                        zip\
>                        )$\N}{1}{0}}

>

Wouldn't be something like this easier?

deny
hosts = !+relay_from_hosts :
condition = ${if match {${lc:$mime_filename}} {\N(\.zip)$\N} {1}{0}}
message = Blacklisted file extension detected in "$mime_filename".