Description ----------- This script provides a content filter program for the Stalker CommuniGate Pro mail server that performs extraction of TNEF attachments and re-attaching them as normal ones. In addition, virus scanning can be done with Clam Antivirus and attachment blocking by regular expressions, applying both to standard MIME attachments as well as contents of TNEF attachments. It's main purpose is provide interoperability in a mixed Windows and Linux environment. Outlook sends attachments such as winmail.dat which are unreadable by most Linux mail clients. This filter utilizes ytnef (http://ytnef.sourceforge.net/) to unpack such attachments and repackage them in a more accessible fashion. For example, meeting requests are converted to .vcf attachments which are readable by the Evolution mail client. Resource scheduling (e.g. conference rooms) can also be setup. The original TNEF (winmail.dat) attachment is kept on the message, and only additional attachments are made. This way the message is still viewable by Outlook users. One side effect is that the Outlook users will see attachments such as 'calendar.vcf' in meeting requests. This is a cost of interoperability. Virus scanning via Clam Antivirus is optionally performed on all attachments on normal MIME attachments as well as the extracted contents of the TNEF file. This filter can completely replace any virus scanning filter you may have, and the virus scanner does not have to support MIME or TNEF decoding. This filter can also block MIME attachments as well as TNEF contents based on simple regular expressions. Blocking of encrypted ZIP files is also supported. Caveats ------- This filter processes requests serially and is not designed for high volume. It should work fine in small office environments. Requirements ------------ I have only tested this on Red Hat Linux 8.0 and CommuniGate Pro v4.1.5. Your mileage may vary. The following are required: MIME::Tools PERL module - get from CPAN ytnef - http://ytnef.sourceforge.net/ Note that for ytnef, I have tested with ytnef 2.3 and libytnef 1.4. Virus scanning requires Clam Antivirus http://www.clamav.net. It is highly recommended that you use this. Setup ----- Check the top of ytnef_cg_filter.pl for configuration settings. If you will be using Clam Antivirus running as a non-root user (e.g. username clamav), make that user part of the mail group which CommuniGate runs as. This is required for Clam to be able to read the mail files. If all is ok, create a filter in CG to run the script. Then create a server-wide rule with the following criteria: Action ExternalFilter and the name you've given to it. CommuniGate Resource Scheduling ------------------------------- CG can do resource scheduling, e.g. conference rooms, as described here: http://www.stalker.com/CommuniGatePro/WebCalendar.html#Automatic The meeting requests must come in a specific format as a singlepart MIME message. To get this working, add the resource users to the %vcf_users hash. Bugs and Suggestions -------------------- If you find any problems or have suggestions, please let me know at valankar@bigfoot.com.