Linux – How to read a single file in a maildir

emailencodinglinux

On my Linux development system I use fakemail to write mails to a directory instead of sending them. The mail files contain the headers and the text of the mail as quoted-printable, text/plain in UTF-8. How can I read a single mail file and "decode" the quoted-printable so line breaks and special chars show up correctly?

Here is an example of a German mail file with line breaks and special chars:

Message-ID: <1317977606.4e8ebe06ceab7@myserver.local>
Date: Fri, 07 Oct 2011 10:53:26 +0200
Subject: Registrierung
From: me@me.com
To: tt99@example.com
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hallo,

Sie haben sich auf Meinserver.de als Benutzer regist=
riert. Um Ihre
Registrierung abzuschlie=C3=9Fen, klicken Sie auf folg=
enden Link:

http://meinserver.de/benutzer/bestaetigen/3lk6lp=
ga1kcgcg484kc8ksg

I want the special chars to be replaced with their proper counterparts and the line breaks inserted by the quoted-printable encoding (the ones with a "=" at the end) removed.

Best Answer

Ok, answering my own question here, based on some googling and the helpful comments by mailq.

In short: I installed and used mutt. I had to fiddle a bit with my setup: Inside the directory my_dir where fakemail was creating the mail files, I created the dirs new, cur and tmp and pointed fakemail to my_dir/new. Then I started mutt with

mutt -f my_dir

Now I can review new mails, look at old mails, the umlauts are properly displayed - perfect!