How to read a winmail.dat file

winmail.dat is a package of e-mail attachments meant for Microsoft Exchange clients. Here is how to open it if you are using an Internet mail client on Linux.

[2009-05-07]

The other day I wanted to read an e-mail with an attachment called "winmail.dat".

I'd seen them before, but I didn't really know what they are, nor why Microsoft Outlook creates them.

It turns out winmail.dat is a package of e-mail attachments and RTF (rich text format) text. It is for Microsoft Exchange clients, and the RTF is so that e-mails can be nicely formated. It is created when you forward an e-mail with attachments in Microsoft Outlook. It has the MIME type "application/tnef". (TNEF stands for Transport Neutral Encapsulation Format.)

Microsoft offers help on how to turn it off when sending Internet e-mails over here. But in my case I wasn't the sender; I was the recipient, and I was still stuck with a useless binary attachment, and I needed a way to open it.

Yerase has created ytnef, Yerase's TNEF Stream Reader, for those of us who don't have anything to handle winmail.dat files. At the time of writing this, the project's homepage, http://ytnef.sourceforge.net, was having some trouble, but I just installed it using my distro's package manager.

On Debian-based distributions, try

$ sudo apt-get install ytnef

or
# apt-get install ytnef

Save winmail.dat, and then extract the attachments it contains to the current directory with

$ ytnef -f . winmail.dat

Nice.

If you are a Mac user, check out Josh Jacob's TNEF's Enough. For Windows users, I found the appropriately-named Winmail.dat Reader. For Linux there is also tnef, ktnef, and an experimental plugin for Evolution.