I wrote this because I couldn't find anything like it on the Internet. Maybe I didn't look hard enough.
Basically, it seems like the non-Outlook email users of the world have simply accepted that the best they can hope for when receiving those annoying messages from outlook users with the stupid winmail.dat attachments is a tool like Fentun which basically allows you to crack open a winmail.dat file when you receive one.
While Fentun is a wonderful tool which I have used for a long time and have had many occasions to be thankful for, it annoyed me that email from Outlook users almost always had an attachment, whether that attachment was empty or not. It also annoyed me to have to click on the winmail.dat file to figure out what was inside.
I wanted something that would intercept email on the fly and modify it so that I could see the attachments normally when they are there, and see nothing when they aren't. Several hours of google later, I started writing tnefclean.
If after all that, the message is found to contain no body and only one text attachment, then the message is altered so that it looks right upon receipt.
When your mail reader gets the message, it actually looks NORMAL.
tnefclean can either be run out of your .forward file, or as a filter in either your mail program or your .procmailrc file.
tnefclean is written in perl and requires NO additional perl modules to
run.
It does, however, require that the following two tools be installed:
I retrieve my email via a pop server. Luckily, I have a shell account on that pop server. It uses sendmail as its MTA. So the first thing I did (after I wrote the tool) was to edit the configuration options in the beginning of the script. Then I just added the following to my .forward file.
| /path/to/tnefclean.plUsing the above method, sendmail forwards all incoming email to tnefclean which then does its thing and finally places the processed email into the mail spool.
tnefclean can also be used as a filter if the -f option is specified. In this case, it sends its output to stdout rather than the spool file. This way, tnefclean can be invoked from within your .procmailrc (for example) like this:
:0fw | /path/to/tnefclean.pl -f
TNEFCLEAN: tnefclean.pl
MIME encoder/decoder:
One thing you should know: I am not interested in modifying this script to use perl modules that are not distributed with perl. ie: no CPAN stuff. Why? Because if you happen to be doing this on a system with no connection to the Internet, it's a PAIN!
That said, I know that my perl skills are far from impressive. There are probably many better and faster ways to do what I've done. If so, be my guest. I'm very open to any READABLE patches.
If you have time to waste, check out my MS spoof page: Mycrosoft Corporation
Thanks!