Živjo Danilo, > I need to block all attachments except those specificly > listed (.pdf, .odt, ...). > How can I achieve that with amavisd-new 2.4.3?
Sorry for a later reply. The $banned_filename_re is a list of rules, each granting or blocking mail if it matches. The list is traversed sequentially (for each mail part individually), the first rule that matches decides fate for this mail part. If no mail parts are blocked by this procedure, entire mail message is not banned. So in order to achieve what you would like, you'd need to place rules explicitly allowing each permissible type first, then have a block-all rule by the end of the list. Something like: $banned_filename_re = new_RE( # explicitly allow the following file(1) types: [ qr'^\.(txt|asc|html|empty)$' => 0 ], [ qr'^\.(pdf|odt|ps)$' => 0 ], [ qr'^\.(rpm|cpio|tar)$' => 0 ], # block all other file(1) types: [ qr'^\.[a-zA-Z0-9]*$' => 1 ], ); The above rules only apply to short content type names as obtained by mapping a result from a file(1) utility through $map_full_type_to_short_type_re mapping (check the source for a default value of this list). It would be possible to add rules on MIME types and on file names to the above, although things may quickly become unmanagable. Keep in mind that a MIME message is a tree structure, all nodes are quivalent in principle, the term 'attachment' is just a commonly (mis)used term for any MIME type beyond the first one. Checking on $banned_filename_re rules does not distinguish between positions of mail parts in a MIME tree, all are treated equally, including the first part. I would not be surprised if it turns out the approach given by the example above tuns out to be less useful than expected. Pozdrav Mark ------------------------------------------------------------------------- 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://sourceforge.net/powerbar/db2/ _______________________________________________ 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/