List Info

Thread: Block but allow in archives




Block but allow in archives
user name
2007-04-20 05:18:18
I want to ban exe,pif,scr,vbs,bat,com,cmd files in
attachment but allow them
in archives like zip,rar,tar,gz,iso,cue,bin.


I have currently

$banned_filename_re = new_RE(
  qr'^.(exe-ms|dll)$',                   # banned file(1)
types,
rudimentary
  [ qr'^.(rpm|cpio|tar|zip|rar)$'       => 0 ],  # allow
any in Unix-type
archives
  qr'..(pif|scr)$'i,                     # banned
extensions - rudimentary
  qr'^application/x-msdownload$'i,        # block these MIME
types
  qr'^application/x-msdos-program$'i,
  qr'^application/hta$'i,
  # block certain double extensions in filenames

qr'.[^./]*[A-Za-z][^./]*.s*(exe|vbs|pif|scr|bat|cmd|com|c
pl|dll)[.s]*$'i,
  qr'..(exe|vbs|pif|scr|cpl)$'i,             # banned
extension - basic
);
------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: Block but allow in archives
country flaguser name
United States
2007-04-20 12:07:42
Azfar wrote:

> I want to ban exe,pif,scr,vbs,bat,com,cmd files in
attachment but allow them
> in archives like zip,rar,tar,gz,iso,cue,bin.


> I have currently

> $banned_filename_re = new_RE(
>   qr'^.(exe-ms|dll)$',                   # banned
file(1) types,
> rudimentary
>   [ qr'^.(rpm|cpio|tar|zip|rar)$'       => 0 ],  #
allow any in Unix-type
> archives
>   qr'..(pif|scr)$'i,                     # banned
extensions - rudimentary
>   qr'^application/x-msdownload$'i,        # block these
MIME types
>   qr'^application/x-msdos-program$'i,
>   qr'^application/hta$'i,
>   # block certain double extensions in filenames

>
qr'.[^./]*[A-Za-z][^./]*.s*(exe|vbs|pif|scr|bat|cmd|com|c
pl|dll)[.s]*$'i,
>   qr'..(exe|vbs|pif|scr|cpl)$'i,             # banned
extension - basic
> );

Possibly:

$banned_filename_re = new_RE(

  # block certain double extensions anywhere in the base
name
 
qr'.[^./]*[A-Za-z][^./]*.(exe|vbs|pif|scr|bat|cmd|com|cpl|
dll).?$'i,

  [ qr'^.(Z|gz|bz2)$'           => 0 ],  # allow any in
Unix-compressed
  [ qr'^.(rpm|cpio|tar)$'       => 0 ],  # allow any in
Unix-type archives
  [ qr'^.(zip|rar|arc|arj|zoo)$'=> 0 ],  # allow any
within such archives
  [ qr'..(iso|cue|bin)$'i       => 0 ],  # allow these
extensions

  qr'^application/x-msdownload$'i,                  # block
these MIME types
  qr'^application/x-msdos-program$'i,
  qr'^application/hta$'i,

 qr'..(ade|adp|app|bas|bat|chm|cmd|com|cpl|crt|emf|exe|fxp|
grp|hlp|hta|
       
inf|ins|isp|js|jse|lnk|mda|mdb|mde|mdw|mdt|mdz|msc|msi|msp|m
st|
        ops|pcd|pif|prg|reg|scr|sct|shb|shs|vb|vbe|vbs|
        wmf|wsc|wsf|wsh)$'ix,  # banned ext - long

  qr'^.(exe-ms)$',                       # banned file(1)
types
);

Gary V



------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )