Manish Kathuria wrote:
> Hello Everyone,
> 
> Is there a way to block all kinds of attachments and then selectively
> allow 2-3 types of extensions only (in addition to plain text) instead
> of the existing mechanism where all the extensions to be blocked are
> specified ?
> 
> Thanks,
> 

I believe the existing mechanism should be sufficient.  You'd want to
first specify which file types you accept, followed by a catchall rule
that rejects everything else.  Something like this abbreviated version
of $banned_filename_re:

$banned_filename_re = new_RE(

### type you allow
# [ qr'^\.(gz|bz2)$'    => 0 ], # allow gzip or bzip2

  qr'^\..*$',                   # ban everything else

);

The order is important - first match wins, so you'd place specific
entries first.

Note the grouping for the gzip/bzip2 rule, and that it maps to 0; this
means to *allow* this type.  Mappings without a value default to 1,
which would mean *disallow*.

You may want to consider including the appropriate MIME types (eg.
application/x-msdos-program) for rejection as well.  Look at the default
and sample $banned_filename_re rules in amavisd.conf-default and
amavisd.conf-sample to determine your needs.

MrC

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
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