Marjan,

> New MS office files are zip archives. That zip archives include base
> document and attacments. The problem is with attecments with file
> extensions wmf and emf.
>
> I would like to block standalone wmf and emf mail attacments, but allow
> wmf and emf inside docx file/archive.
>
> The folowing example would allow any file inside archive.
>
> ### BLOCK THE FOLLOWING, EXCEPT WITHIN ARCHIVES:
>   [ qr'^\.(zip|rar|arc|arj|zoo)$'=> 0 ],  # allow any within these archives

Right.

> But, is it possible to define new banned "policy" for archive, to allow
> some files and to banned some others.

Depends on what how your 'archive' is implemented or what you mean by that.

If an archive is implemented by a dedicated e-mail address and you
want this address to have different banning rules than the rest,
then yes, per-recipient banning rules are possible.

Search RELEASE_NOTES for:
  banned filename/filetype rules can now be specified
  on a per-recipient basis


Something like this:

@banned_filename_maps = (
  {
   'arch...@example.com' => 'ARCHIVE_RULES',
   'use...@example.com' => 'ALLOW_EXE',
   'us...@example.com'  => 'ALLOW_VBS',
   'us...@example.com'  => 'ALLOW_VBS,ALLOW_EXE',
   '.' => 'DEFAULT',
 },
);

%banned_rules = (
  'ARCHIVE_RULES' => new_RE( [qr'^' => 0] ),  # allow all
  'NO-MS-EXEC'=> new_RE( qr'^\.(exe-ms)$' ),
  'ALLOW_EXE' => # pass executables except if name ends in .vbs .pif .scr .bat
    new_RE( qr'.\.(vbs|pif|scr|bat)$'i, [qr'^\.exe$' => 0] ),
  'ALLOW_VBS' =>  # allow names ending in .vbs
    new_RE( [qr'.\.vbs$' => 0] ),
  'NO-VIDEO' => new_RE( qr'^\.movie$',
    qr'.\.(asf|asx|mpg|mpe|mpeg|avi|mp3|wav|wma|wmf|wmv|mov|vob)$'i, ),
  'NO-MOVIES' => new_RE( qr'^\.movie$', qr'.\.(mpg|avi|mov)$'i, ),

  'MYNETS-DEFAULT' => new_RE(
    [ qr'^\.(rpm|cpio|tar)$' => 0 ],  # allow any in Unix-type archives
    qr'.\.(vbs|pif|scr)$'i,           # banned extension - rudimentary
#   qr'.\.(exe|vbs|pif|scr|bat|cmd|com|cpl)$'i, # banned extension - basic
    qr'^\.(exe-ms)$',                 # banned file(1) types
  ),

  'DEFAULT' => $banned_filename_re,
);


( greeting from two blocks away :)
Mark

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
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