Linux Step By Steps

Accessing winmail.dat attachments from Mozilla on Linux

Written by James McDonald on 2003-May-11.

Microsoft uses a "application/ms-tnef" mimetype to encapsulate it's email messages. Sometimes you need to be able to get to the contents of them for example when they contain documents and zip files. Sourceforge has a tnef unpacker which can be used for this and you can get mozilla to pass the winmail.dat attachment to tnef and then show the unpacked contents in your favourite file browser
Download and Install tnef

tar -zxvf tnef-1.2.1
cd tnef-1.2.1
./configure --prefix=/opt
su -c 'make install'

Create a wrapper script for Mozilla to execute and pass the winmail.dat attachment to tnef for unpacking

touch /usr/local/bin/
vi /usr/local/bin/

Enter the following into


# wrapper script to unpackage winmail.dat attachments in mozilla

# This can be anywhere you think is a good place to unpack stuff to

TNEF=`which tnef`
# put your favourite file browser in here
FILEBROWSER=`which konqueror`

$TNEF --file=$FILE --directory=$UNPACKTO --number-backups


Make executeable

chmod +x /usr/local/bin/

In Mozilla open one of your emails that contains a winmail.dat attachment in it. When Mozilla prompts you for a program to launch the winmail.dat attachment associate it with the wrapper script