because of a transition from MS Exchange to Courier IMAP, all our old mail messages have a winmail.dat attachment, which sometimes contains also the message's original attachments. I am looking for a tool which will scan a whole Maildir and convert the winmail.dat-s to "normal attachments" (or delete the ones that just contain the RTF version of the message). I realize there are some commandline tools for *nix, but I have not found an automated solution to process whole Maildirs. Suggestions?
Sorry to respond to such an old question - I'm sure the above answers and comments are a good solution - but I'd like to point to tnef (http://sourceforge.net/projects/tnef/ and https://github.com/verdammelt/tnef) which perhaps could be used to script a solution.
(Full disclosure: I am the author/maintainer of that tool).
Some searching over the last few minutes reveals that a lot of people are using Outlook Express or Thunderbird to do this kind of conversion by downloading the messages and then moving them back to the IMAP server. If you have just a few mailboxes to do that might end up being the path of least resistance.
It looks, to me, like you're going to either be chaining a group of smaller utilities together or scripting something "from the ground up" yourself. It looks like there are probably enough Python and Perl modules that handle parsing maildirs that it shouldn't be too hatefully bad to write. It doesn't look like fun, though. (I hate writing code that deals with email, personally...)
Edit:
Here's a couple of links re: the Outlook / Outlook Express converstion of WINMAIL.DAT files. I haven't got any of these messages w/ TNEF attachments laying around in a handy place to give it a try.