![]() |
| ||||||
![]() | ![]() | ![]() | |||||
![]() |
|||||||
Postfix NotesHow to configure Postfix to deliver mail to Cyrus IMAPd Shared FoldersThis proved to be trickier than expected. There may be a cleaner way to do this. How to implement content/attachment filters based upon filenames with PostfixThe goal is to filter mail based upon attached files (that is their extensions) with possibly harmful content. There is a simple content filter capability built into Postfix (See Postfix documentation) but what I wanted to do was one step ahead of this: Reject (evtl. recursivly) zipped versions of unwanted files also. This is a quite rigorous counter measure, but in times of Macro viruses it might be worth considering. Please note that this solution bounces any offending mail (i.e. mail that contains an attachment with a filename you configured as unwanted. It does not remove the attachment. Also note that the script as downloadable here comes with various extensions preconfigured. You might want to change this default. The interface to Postfix is managed using Macofida (see the link below), which runs as a daemon. It calls the filter script, which uses MIME-Tools to decode the message and scans the attachments for offending filenames. The same tools can be used to implement any filter. In fact Macofoda is intended to be a filter interface for Postfix. The Tools used:Macofida which some additional Perl modules - see below MIME Tools which - guess what - needs some additional Perl modules Our filter script Adapt this to your needs. The following Perl Modules are needed for MIME-Tools: Macofida needs these modules: Using Postfix with SSL/TLSLinks:Postfix/TLS |