Pierre wrote:

> Hello,
>     i'm trying to find out if it's possible to have a user specific 
> $banned_filename_re variable and if so how to set it up? 

> We don't want to put the user in the banned*lover list, we just want to 
> take out some of the banned extension for that person.

> Thanks.

Using static maps I think this is how it's done (but I have
not tested, so you should).

If you use 2.3.0 or newer and your intent is to allow a particular
recipient to receive certain files that are blocked by the current
settings in banned_filename_re, you could first redefine the
%banned_rules hash and include a complete custom set of
$banned_filename_re settings there. In addition, this hash
necessarily includes the 'DEFAULT' set of banned_filename_re
settings currently defined in $banned_filename_re and is
necessarily positioned after the existing
$banned_filename_re new_RE( ... ); setting. For example:

%banned_rules = (
  'ALLOW_EXE' =>  new_RE(
      [qr'.\.(exe|com)$'i => 0],  # pass .exe and .com files
      # block certain double extensions anywhere in the base name
      qr'\.[^./]*[A-Za-z][^./]*\.(exe|vbs|pif|scr|bat|cmd|com|cpl|dll)\.?$'i,
      [ qr'^\.(rpm|cpio|tar)$'       => 0 ],  # allow any in Unix-type archives
      qr'.\.(vbs|pif|scr|cmd|cpl|bat)$'i,  # banned extension - basic
      qr'^\.(lha|cab|dll)$',  # banned file(1) types
      ),
  'DEFAULT' => $banned_filename_re,
);

Then the per recipient map:

@banned_filename_maps = ({
  '[EMAIL PROTECTED]' => 'ALLOW_EXE',
  '.' => 'DEFAULT'
});

Search RELEASE_NOTES for:

- banned filename/filetype rules can now be specified on a per-recipient basis

Gary V


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
[email protected]
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