Reading an Outlook distribution list on Linux or BSD


So one of your colleagues sends you a distribution list from Outlook, and it arrives as a winmail.dat file. To extract the email addresses you'll need the tnef tool installed, which is available in the package repositories for most Linux distributions and BSD variants. Save the winmail.dat attachment to disk, and unarchive it with tnef:

$ tnef winmail.dat

This will leave you with a binary file, typically with a filename of Untitled Attachment. Now extract the email addresses using the strings(1) tool, with an encoding parameter that tells it to look for bigendian UTF-8 characters:

$ strings -e b "Untitled Attachment" | grep @ > addresses.txt

Job done.