Hi

First I had troubles compiling ytnef into my freebsd system, switching to the tnef package supplied in freebsd' ports didnt do the trick either. It was then I replied to your post :)

Fiddeling around I found that tnef dont return the actual files, or at least I have'nt gotten it to, as ytnef does.
@new_files = `/usr/local/bin/tnef -f Work $path`; will therfore fail.

So the soution:
Using Rached Blili's tnefclean.pl script as a reference I hacked together a mimedefang filter which uses tnef instead of ytnef.

The logic is as follows.
Use tnef to extract the filenames and put them in an array.
Use tnef to extract the files into a tmpdir.
Merge the patch to the tmpdir with the filenames into an array and you have a full path to the extracted files.

*Note* I guess this is somewhat nasty since I let the script deal with the full path to the files instead of separation the path and filename. It shows up in i.e pine where the filename is presented with the full path as its name. How

Supply this array to the functions in the patch. Should work fine.
This is actually all that is required, and it works very well according to my needs.

I also added some cleanup at the end, removing the "X-MS-TNEF-Correlator" header, adding a new one and deleting the tmp directory.

Please note that:
This was my very first encounter with perl scripting and I guess there are several better solutions to this problem. The reason for wanting to kill the winmail.dat attachments is because we have a mix of outlook and thunderbird users. I know very well that the tnef problem should be dealt with clientside, but that is not an accepted solution for me. The only problem we have with tnef mail is when outlook sends a rft coded mail, there are no exchange server involved, so this is purely a client to client problem.

Hope this helps somenoe else wanting to do this serverside :)

regards
Thomas

begin:vcard
fn:Thomas Tinglum
n:Tinglum;Thomas
org:;IT Drift
email;internet:[EMAIL PROTECTED]
tel;work:72884561
tel;cell:98643434
x-mozilla-html:FALSE
version:2.1
end:vcard

_______________________________________________
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list
[email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to