A while back I posted a question about whether it was possible to get
mutt to decode utf-7 (rfc2152) encoded messages automatically for me.
Not suprisingly, I didn't hear back from anyone.  (Out of all the
people I get mail from, I've only seen utf-7 from one of them, so it
isn't exactly a common format.)  Since then I've hacked together a
solution, and although I don't think it is "the right way" I thought I
would mention it in case anyone else runs into similar issues, and in
the hope that maybe someone will decide to take it from here and
actually do it the right way. ;)

My solution was to add a procmail recipe which checks for a header of
the form Content-Type:.*charset="utf-7" and pass the mail through a
utf-7 to utf-8 filter program and then through formail to rewrite the
Content-Type line so the charset says utf-8.  All sorts of fun
encoding filters can be found in Chinese-HOWTO, although I think I
found the one I use at the bottom of the list at
http://cnapps.ifcss.org/unconv.html (the one called simply "utf7").

I believe that this approach is not the right way for two reasons.
One is philosophical, and probably the result of listening to ESR on
fetchmail-friends for too long: this should be the job of the MUA, not
the MTA.  The other issue is practical, and is that some other headers
may also need to be rewritten, like "Content-Transfer-Encoding: 7bit"
for instance.  Even if it is possible to figure out what all of the
relevant headers should be, I know I'm not up to the task of doing it
myself, so until I come up with a generally more robust solution I'm
chosing to live with my discomfort.

If anyone out there who is familiar with the character set handling in
mutt is interested in tackling this problem, I'd be happy to pass on
all the info I've got.  I may get around to trying to tackle this one
myself, but it won't happen anytime soon.  If this isn't actually
something that mutt should be dealing with, I'm interested to hear
where support really should be coming from.

Brian

Reply via email to