html-stripper-0.1 patch and problems with MIME multipart messages

Toomas Aas <[email protected]>
Newsgroups gmane.mail.majordomo.general
Message-ID <[email protected]>
Hello!

I seem to have a problem with html-stripper-0.1 patch and some MIME 
multipart messages.

Let's say the original message looks someting like this:

==========================================================
From: sender <[email protected]>
Date: Mon, 12 Mar 2007 19:49:30 +0200
To: [email protected]
Subject: =?utf-8?q?p=C3=A4iste=20test?=
MIME-Version: 1.0
Content-Type: multipart/alternative;
     boundary="--------=BoundaryPyDog1173721770.89------"
Message-Id: <[email protected]>


----------=BoundaryPyDog1173721770.89------
Content-Type: text/plain;
     charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Mis paistab kirja p=C3=A4istes? (katse nr 1)
----------=BoundaryPyDog1173721770.89------
Content-Type: text/html;
     charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Mis paistab kirja p=C3=A4istes? (katse nr 1)
----------=BoundaryPyDog1173721770.89--------

==========================================================

So it's an multipart/alternative message with text/plain part specifying 
charset UTF-8.

After passing through Majordomo with html-stripper enabled and 
html_policy set to 'strip', the message becomes something like this:

==========================================================
From: <[email protected]>
Date: Mon, 12 Mar 2007 19:49:30 +0200
To: [email protected]
Subject: =?utf-8?q?p=C3=A4iste=20test?=
MIME-Version: 1.0
Content-Type: text/plain
Message-Id: <[email protected]>
Sender: [email protected]
Precedence: bulk

Mis paistab kirja päistes? (katse nr 1)
==========================================================

As you see, the content-type in message headers has changed from 
multipart/alternative to text/plain, but the charset info has been 
completely lost. As a result of this, the message body contains raw 
8-bit characters which remain untranslated in MUA.

If I set the list's html_policy to 'pass', the message passes through 
with all it's parts intact and is displayed correctly to users.

I tried to look at the code of html-stripper-0.1 patch, but I'm not a 
programmer so only thing I got was a headache ;) Maybe someone has a fix?

Thanks in advance,
--
Toomas Aas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.