Jeff Epler's blog

2 December 2013, 19:30 UTC

mailpie moves to github

My e-mail full text search software mailpie is now hosted at github:


20 September 2011, 18:49 UTC

tnef2mime: automatically extract parts from winmail.dat

In her professional life, my fiancée routinely gets emails with attachments in the 'winmail.dat' aka application/ms-tnef format. It does her no good to berate these prisoners of proprietary software, so I set out to provide her with an easy-to-use solution that would work on her end. Now, prompted by this blog entry I am posting it for others to use.

There are a number of programs that can rescue data from this proprietary attachment format, but I was not aware of a program that would automatically convert the winmail.dat attachment to (a series of) regular mime attachments. (it appears that ytnef_smtpd may be such a program)

So I wrote one, tnef2mime reads a message on standard input, combs it for ms-tnef attachments, and uses the tnef(1) program to extract their contents. Then it takes the extracted files, adds them as new MIME parts, and prints the whole resulting message.

This is suitable for use in e.g. procmail:

| tnef2mime

Several steps are taken in order to minimize the chances for data loss: Just in case it did an imperfect job, it leaves the existing ms-tnef attachment intact. If any problem is encountered, the unmodified message is written.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Files currently attached to this page:



1 May 2008, 21:33 UTC

mailpie: updated to version 0.2

I love this little program and now I don't know how I lived without it.

Aside from bugs fixed, the main improvement is a double-level indexing scheme that makes it fast to add messages just one or a few at a time.


All older entries
Website Copyright © 2004-2024 Jeff Epler