[[PageOutline(2-5,Contents,pullout)]] = Reject attachments = == Description == A very simple plugin to reject attachments, with file-extension based rules. == Bugs/Feature Requests == Existing bugs and feature requests for AttachFilterPlugin are [report:9?COMPONENT=AttachFilterPlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=AttachFilterPlugin&owner=eblot new ticket]. == Download == Download the zipped source from [download:attachfilterplugin here]. == Source == You can check out AttachFilterPlugin from [http://trac-hacks.org/svn/attachfilterplugin here] using Subversion, or [source:attachfilterplugin browse the source] with Trac. == Documentation == In `trac.ini`, add a new section `[attachment_filter]`, where: * keys match the mime file type to exclude * values gives a brief description that is shown to the user to explain why the file is rejected === Example === {{{ #!ini [attachment_filter] application/vnd.ms-excel = Microsoft Excel documents should be attached as PDF files application/vnd.ms-powerpoint = Microsoft PowerPoint documents should be attached as PDF files application/msword = Microsoft Word documents should be attached as PDF files image/bmp = Microsoft bitmap images should be attached as PNG images }}} Yep, M$ is evil :-) === MIME type === To obtain the exact MIME type string: 1. set up your Trac installation to show/dump INFO log message, 1. attach a file of the (un)desired type 1. look for the plugin trace that shows the file name and the MIME type: {{{ grep Filename .../log/trac.log }}} {{{ 2011-05-16 15:49:26,299 Trac[filter] INFO: Filename stuff.doc, filetype application/msword }}} 1. add this new MIME type to the `[attachment_filter]` section 1. restart your Trac engine == Recent Changes == [[ChangeLog(attachfilterplugin, 3)]] == Author/Contributors == '''Author:''' [wiki:eblot] [[BR]] '''Maintainer:''' [wiki:eblot] [[BR]] '''Contributors:'''