Decoding Winmail.dat
EDIT: Added a note from Jason Lynch about the iPhone App for viewing winmail files -thanks Jason!
When you receive an email message with an attached “winmail.dat” file, often the first instinct is to get it sent again (or delete it!). However often this doesn’t work at getting the attachment out…. There are however a couple of tools of useful on the Mac to resolve this…
A bit of background – these files are created by Outlook sending mails in its own “Rich Text” format. As a result, the attachments (and sometimes the mesage) are not being encoded/decoded correctly along the way…
Some mail servers (Kerio Connect being one of them) have filters that can decode the messages, but even this doesn’t always help.
On the iPhone
Letter Opener – Jason Lynch pointed me at this site – http://itunes.apple.com/au/app/winmail-dat-viewer-letter/id395502240?mt=8 for Letter Opener – great tip for an app that will open them up on iOS Devices…
On The Mac - TNEF To The Rescue
We used to use
TNEF’s Enough: http://www.joshjacob.com/
Which has traditionally been a great tool for this – a Shareware product for decoding those files.
TNEF’s enough is easy to use – just launch the application, go to “File” – choose “Open”
and it asks you where the file is you’d like to decode:
which then offers to save off the documents… great!
However – TNEF’s enough sometimes isn’t decoding more recent winmail.dat files.
There is however “tnef”, a command line tool that is regularly being updated .
This is a command line tool which provides the same functionality – and is being actively developed by the open source community. It gets me out of a bind on a weekly basis…. So I’ve done a bit of “howto” on tnef:
Downloading tnef.
At the time of writing, the current version of tnef is version 1.4.7. Go off to the http://tnef.sourceforge.net and download the tnef-1.4.7.tar.gz file from the downloads section.
Place this file in your home directory, and “unzip” it by double-clicking on the file. It should create a “tnef-1.4.7″ directory.
To get “tnef” to do it’s magic. You need to compile this software to work on the Mac.. For those of you who have done this a thousand times before, you can skip through to “decoding” a Winmail.dat” below but otherwise:
Compiling
To compile the tnef application – you’ll need to have installed the Apple XCode Tools. You can get the most recent release of these at developer.apple.com (login required), or through the Mac App Store but you can also get (slightly older) versions tools on the OS X DVD’s, if you have one of these. XCode is around 1GB – so maybe grab the DVD if you’re in a pinch… Install the developer tools then you’re set.
To compile, open a “Terminal” application (you can find that in Applications: Utilities)
Then, enter the following commands (and type return between the lines):
cd ~/tnef-1.4.7
./configure
make
sudo make install
This will run a bunch of results off the top of the screen for each command, After the last command is typed you will have to type your “admin” password – the password you use when installing software on your computer or changing settings.
Decoding a winmail.dat
Assuming this does the trick – you should now be able to run the “tnef” command, to extract your files. Make a folder to create your decoded files:
mkdir ~/decoded
Then type
tnef -f ~/winmail.dat -C ~/decoded.
(assuming the winmail.dat file is in your home directory)
You should now find the contents of your files waiting for you in the decoded folder - in your home directory (which might have your name - not mine!)
Cleaning up
After you’ve installed tnef, you no longer need the ‘tnef-1.4.7′ directory – so this can be deleted, as can the “tnef-1.4.7.tar.gz”. After the winmail.dat has been decoded – you can get rid of that too!!!
Tags: Mail, winmail.dat


