Monday, April 21, 2008


Just got this email from a frustrated colleague:
any idea why this keeps happening? mike's attachments keep appearing as winmail.dat files when i receive them.
The winmail.dat file is a 84KB file of unknown origins. So I detached the file, and looked at it via the command line:

yky@x1407:~/Desktop$ more winmail.dat
x�>"���� IPM.Microsoft Mail.Note  �^L^L7


Googling "winmail.dat attachments" brought me to this informative page.


The Microsoft Outlook e-mail program sometimes sends e-mails in the Transport Neutral Encapsulation Format (TNEF). Most other e-mail programs, including Thunderbird, do not understand TNEF.

If your e-mail program doesn't understand TNEF, instead of seeing the e-mail and/or attachment, you may only see an attachment named "winmail.dat" or "Part 1.2" that you cannot open. Also, sometimes you may receive a TNEF attachment with a generic name such as ATT00008.dat or ATT00005.eml instead.

The solution is to have a TNEF decoder. I typed "tnef" on my ubuntu shell, and it was already installed. 'man'ed it and found that the syntax is:
tnef -vf winmail.dat
'v' is for 'verbose' so that it lists what file names it successfully decodes, and the 'f' flag is to indicate which input file to use (otherwise it uses stdin).

Thats all there is to it. The encoded file will then appear, forward it to your colleagues and their frustrations will subside ... at least till yet another Outlook user decides to harass em.


1 lewser:

mysurface said...

I remember thunderbird have such plugin for tnef, if my memory served me right.

That will do aways a lots of trouble of having to save the attachment and run the command line.