Sei sulla pagina 1di 2

TNEF_FIX.VBS Version 1.

0 DESCRIPTION ----------This is an add-in script designed for use with MDaemon mail server to eliminate annoying winmail.dat attachments. These are the result of messages being sent i n Microsoft Outlook/Exchange's Rich Text format and are saved in TNEF format (Tr ansport Neutral Encapsulation Format). This script enables the mail server to automatically extract the contents of win mail.dat attachments and deliver the email with the extracted contents. Note this has only been tried on a lightly-loaded mail server ahndlign no more t han 10-20 TNEF attachments per hour. The performance on very busy servers is un known.

HOW IT WORKS -----------Using MDaemon's content filter a rule is created to pass any emails with TNEF en coded sections to this script. The script moves the message out of the MDaemon queue into a temporary working folder and optionally saves a backup copy of the original message before rebuilding it. The script extracts then decodes the TNEF data from the original email, saving t he attachments in a temporary folder. A new email is then built using the origi nal headers and message and attaching the extracted files. This method ensures that the original message headers and any non-TNEF sections of the email remain intact. Any text in the rich text message is converted to a file called message.rtf (Ric h Text Format) which is also added to the converted message. Once the new message is finished it is copied back to the MDaemon queue for deli very and the temporary working folders are deleted.

INSTALLATION -----------The script calls an external mime encoding/decoding utility which is an old DOS tool and does not handle long file & path names so the script must be saved in a folder with a short name. I use C:\tnef_fix\ however you can use any other fold er if you wish. If you have chosen to use any other folder you will need to edit the tnef_fix.vb s script to change the folder references. In the settings part of the tnef_fix.vbs file are several options that can be ch anged: - the location where the script will create temporary working folders - the location where backup copies of the original email files will be saved (or blank if no backups are required) - the locations of the two utility programs used by the script - whether to include an extra X_TNEF_FIX header in the finished email (useful fo

r tracking) - whether to include a short note in the plain text part of the email explaining that the TNEF data has been decoded. This is only normally viewable when looki ng at the source code of an email. You also need to set up a new rule in the MDaemon Content Filter: Apply rule to messages in the LOCAL queue If the message has a file called winamail.dat or if there's an attachment with c ontent type application/ms-tnef then Run a program: cscript C:\tnef_fix\tnef_fix.vbs $MESSAGEFILENAME$ When the script is processing suspend all operations for -1 second (until script finishes) Run process in a hidden window Alternatively the following can be copied into the app\cfrules.dat file: [Rule***] - use next available rule number RuleName=TNEF Fix Enable=Yes ThisRuleCondition=Any ProcessQueue=LOCAL Condition01=body|has content-type|AND|application/ms-tnef Condition02=body|attachment name|AND|winmail.dat Action01=run a program|"-1,0,1","cscript C:\tnef_fix\tnef_fix.vbs $MESSAGEFILENA ME$" Once the rule is made live then any TNEF encoded emails should be trapped (wheth er or not the have an attachment called winmail.dat). The script should process the message and replace the winmail.dat attachment in the email with the true a ttachments.

DISCLAIMER ---------This software is provided "AS IS" without any warranty, either r implied, including, but not limited to, the implied warranties of lity and fitness for a particular purpose. The author will not be any special, incidental, consequential or indirect damages due to a or any other reason. You are welcome to use this software without kind of fee.

expressed o merchantabi liable for loss of dat paying any

LICENSES -------The script calls two freeware utility programs, MIME64 by Karl Hahn and Winmail Opener by Eolsoft. These two programs are included in the utility folder togeth er with their license agreements. Apart from the two utility programs listed above, this script is released into t he public domain. You are free to do with it as you wish however I would ask as a courtesy that you let me know of any changes that you make to the code. ----------Paul Oliver p.oliver@imc-uk.com

Potrebbero piacerti anche