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.