Hi,
When I use 8-bit accented characters in extra headers in Mozilla
1.2.1/Linux (official mozilla.org binary release), they are not sent
using quoted-printable.
Here is an example: I send a message to the root user on the system
where my MTA resides.
MUA system (RH 7.3) MTA system (RH 6.1)
Mozilla 1.2.1 --> root user mbox file
Message composed using ISO-8859-1
Here is the message as it appears in the root mbox:
BEGIN MESSAGE --------------------------------------------------------
From maurice...@kariboo.com Wed Mar 12 08:57:27 2003
Return-Path: <maurice...@kariboo.com>
Delivered-To: root@corp
Received: (qmail 4367 invoked from network); 12 Mar 2003 08:57:27 -0000
Received: from nestor.corp (HELO kariboo.com) (10.0.0.6)
by jarvis.corp with SMTP; 12 Mar 2003 08:57:27 -0000
Message-ID: <3E6EF676...@kariboo.com>
Date: Wed, 12 Mar 2003 09:57:26 +0100
From: Maurice Galland <maurice...@kariboo.com>
Reply-To: maurice...@kariboo.com
Organization: Kariboo Technologies SA
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: fr-ch, fr-fr, fr, en-us, en
MIME-Version: 1.0
To: root@corp
Subject: =?ISO-8859-1?Q?=E9=E8=EA=E0=E2=F4=FB=EE=E4=F6=FC=EB=EF=E7=F1?=
X-FAX-Cover-Comments: รฉรจรชร| รขรดรปรฎรครถรผรซรฏรงรฑ
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Status: RO
้่๊เโ๔๛๎ไ๖๋๏็๑
END MESSAGE ----------------------------------------------------------
The same string is used in the body as in the Subject header and the
X-FAX-Cover-Comments extra header: ้่๊เโ๔๛๎ไ๖๋๏็๑
As you can see, this string appears as is in the body, as
quoted-printable in the Subject header, but is trashed in the
X-FAX-Cover-Comments extra header. It is probably bare ISO-8859-1,
because if I send this message to myself, Mozilla displays it correctly
when I switch to View->Headers->All.
Shouldn't all the headers be encoded as quoted-printable according to
RFC2047 ???
Maurice
----------------------------------------------------------------------
Maurice Galland maurice...@kariboo.com
Kariboo Technologies SA Tel: +41 21 641 05 50
Chemin de la For๊t 4 Fax: +41 21 641 05 52
1018 Lausanne - Switzerland
Is it somewhat related to the pref "mail.strictly_mime_headers" ?
As I can see from the "about:config" URL, mine is set to true.
???
Maurice
--
In Mozilla source code, mailnews/compose/src/nsMsgCompUtils.cpp use the
ENCODE_AND_PUSH() macro to QP the To: From: CC: Reply-To: Subject:
fields (as well as a bunch of others) but use the PUSH_STRING() macro
around extra headers.
ENCODE_AND_PUSH() use nsMsgI18NEncodeMimePartIIStr() to convert from
UTF-8 to QP. UTF-8 seems to be the charset used internally to manipulate
headers (?).
PUSH_STRING(), defined in ./mailnews/compose/src/nsMsgSend.h, does not
touch encoding.
I don't know for sure if it's a bug or if extra headers should not be
QPed for any particular reason. Any idea ?
See the old bug #68394:
http://bugzilla.mozilla.org/show_bug.cgi?id=68394
for a similar problem regarding newsgroup posting.
Maurice
PS: Am I the only one on this thread ? I start to feel a bit 21st
century schizoid. REALLY no one interested ? :,o
> PS: Am I the only one on this thread ? I start to feel a bit 21st
> century schizoid. REALLY no one interested ? :,o
I'm here, just nothing to say...
--
J.B. Moreno
> Found it!
>
> In Mozilla source code, mailnews/compose/src/nsMsgCompUtils.cpp use the
> ENCODE_AND_PUSH() macro to QP the To: From: CC: Reply-To: Subject:
> fields (as well as a bunch of others) but use the PUSH_STRING() macro
> around extra headers.
>
> ENCODE_AND_PUSH() use nsMsgI18NEncodeMimePartIIStr() to convert from
> UTF-8 to QP. UTF-8 seems to be the charset used internally to manipulate
> headers (?).
>
> PUSH_STRING(), defined in ./mailnews/compose/src/nsMsgSend.h, does not
> touch encoding.
>
> I don't know for sure if it's a bug or if extra headers should not be
> QPed for any particular reason. Any idea ?
There is a problem as you need to deal with multiple custom headers.
ENCODE_AND_PUSH won't do this IIRC, you need to encode when you create
the header which is in js. OR open up a whole can of worms and split
all the OTHER_RANDOM_HEADERS up again encode and then repush
Unfortunatly there is no access to the MIME encoding from js :-(
>>> X-FAX-Cover-Comments: éèêÃ| âôûîäöüëïçñ
>>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>> Content-Transfer-Encoding: 8bit
>>> Status: RO
>>>
>>> ��������������ñ
>>>
>>> END MESSAGE ----------------------------------------------------------
>>>
>>> The same string is used in the body as in the Subject header and the
>>> X-FAX-Cover-Comments extra header: ��������������ñ
>>>
>>> As you can see, this string appears as is in the body, as
>>> quoted-printable in the Subject header, but is trashed in the
>>> X-FAX-Cover-Comments extra header. It is probably bare ISO-8859-1,
>>> because if I send this message to myself, Mozilla displays it
>>> correctly when I switch to View->Headers->All.
>>>
>>>
>>> Shouldn't all the headers be encoded as quoted-printable according to
>>> RFC2047 ???
Mail yes, news maybe not
This would be an easy fix if MIME encoding was available from user land...
/James