Block .html only in .zip

Marius Gologan marius.gologan at
Fri Jul 24 22:55:51 CEST 2015



I didn’t test this rule. I just made it up:


$banned_namepath_re = new_RE(

[ qr'(?# BLOCK HTML as application/x-zip-compressed)

^ (.*\t)? M=application/x-zip-compressed

\t(.*\t)* T=html? 

\t(.*\t)* N=[^\t\n]* \. zip 

(\t.*)? $'xmi => 'DISCARD'],


Run this command below and see what’s the Mime-Type of that file an replace the value in M=. Can be different than application/x-zip-compressed.
file –i

When you run your test, place this in your amavis and restart it. Will give you many combined values matched against $banned_namepath_re.
@debug_sender_maps = ( ["test-sender\@$mydomain"] );



From: amavis-users [ at] On Behalf Of Konstantin
Sent: Friday, July 24, 2015 7:05 PM
To: amavis-users at
Subject: Block .html only in .zip



Is it possible to set up banned_rules to block .html,.htm if they are only inside attached .zip file?

I can not block .html,.htm files because some users want to receive them.

For example:
unzip -l Downloads/
Archive:  Downloads/
  Length      Date    Time    Name
---------  ---------- -----   ----
      654  2015-07-22 19:38   2101_resume.htm



This message was delivered using 100% recycled electrons.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the amavis-users mailing list