This proved to be trickier than expected. There may be a cleaner way to do this.
sharedboxname@bsg.at sharedboxname@shared.bsg.atPut this either in /etc/aliases or in /etc/postfix/virtual.
shared.bsg.at cyrusbb:
postmap /etc/postfix/transport
cyrusbb unix - n n - - pipe
flags=R user=cyrus argv=/usr/cyrus/bin/deliver -e -m ${user}
transport_maps = hash:/etc/postfix/transport
postfix reload
The 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: