The basic idea is to allow before you block. Be
mindful of where things are placed. You want to
make sure the stuff you want blocked is before
the stuff you allow. In other words, if you want to
allow exe files, but only if they are zipped,
place all the stuff you want blocked before you
allow anything (but don't include exe type files
in the files you want blocked yet). Then, allow
zipped files. Then, place anything that might
detect a file as an exe, after the point where
zipped files are allowed.


$banned_filename_re = new_RE(
  # block certain double extensions in filenames
  qr'\.[^./]*[A-Za-z][^./]*\.\s*(exe|vbs|pif|scr|bat|cmd|com|cpl|dll)[.\s]*$'i,

  qr'.\.(vbs|pif|scr|cpl)$'i, # banned extension - basic
  qr'^application/hta$'i, # block

 [ qr'^\.(zip|rar)$'=> 0 ],  # allow - (stop looking if zipped)

  qr'^\.(exe-ms|exe|dll)$', # banned file(1) types, rudimentary
  qr'.\.(exe)$'i, # banned extension - basic
  qr'^application/x-msdownload$'i, # block these MIME types
  qr'^application/x-msdos-program$'i,
);

Gary V

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to