Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 314351 - Reply to .EML or message/rfc822: problems with MIME-encoded Subject
: Reply to .EML or message/rfc822: problems with MIME-encoded Subject
: intl
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: Thunderbird 13.0
Assigned To: Hiroyuki Ikezoe (:hiro)
: 437307 485800 (view as bug list)
Depends on:
Blocks: 269826
  Show dependency treegraph
Reported: 2005-10-29 13:38 PDT by Mike Cowperthwaite
Modified: 2012-02-21 02:30 PST (History)
11 users (show)
m_kato: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

Message with MIME-encoded headers (505 bytes, message/rfc822)
2005-10-29 13:47 PDT, Mike Cowperthwaite
no flags Details
utf-8 QP encoded From; utf-8 body has problem (487 bytes, message/rfc822)
2008-10-03 17:37 PDT, Mark Sapiro
no flags Details
utf-8 QP encoded From; iso-8859-1 body - no problem (489 bytes, message/rfc822)
2008-10-03 17:41 PDT, Mark Sapiro
no flags Details
Proposed fix (2.35 KB, patch)
2012-01-13 19:20 PST, Hiroyuki Ikezoe (:hiro)
mozilla: review+
Details | Diff | Splinter Review
The test (1.97 KB, patch)
2012-01-15 21:58 PST, Hiroyuki Ikezoe (:hiro)
mozilla: review+
Details | Diff | Splinter Review
Revised test (1.98 KB, patch)
2012-02-15 15:19 PST, Hiroyuki Ikezoe (:hiro)
hiikezoe: review+
Details | Diff | Splinter Review

Description Mike Cowperthwaite 2005-10-29 13:38:43 PDT
TB 1.6a1-1028, Win2K

With the patches for bug 268746 and bug 204350, it is now possible to use the
Reply, Forward and Edit As New commands in a message window that's displaying a
.EML file or a message/rfc822 attachment.

However, if the Subject or From headers have been MIME-encoded, replying to such a message mangles the Subject and To headers in the new composition.  (However, CC: and To: headers are copied correctly, in the case of a Reply All.)  The exception seems to be if the header is tagged as ISO-8859-1 and/or all its contents fit in ISO-8859-1.

This appears to be true regardless of the encoding used by the message itself
or for the new message composition -- whether or not either or both are the same encoding as the header in question, the resultant header is wrong.

Test message forthcoming.
Comment 1 Mike Cowperthwaite 2005-10-29 13:47:04 PDT
Created attachment 201291 [details]
Message with MIME-encoded headers

Steps to reproduce:
1) Save this attachment to disk.
2) Open it from Thunderbird (or Seamonkey) using   File|Open
3) In the message window, click Reply All

Actual results:
To: field (originally Big5) and Subject: field (Windows-1255) are gibberish; 
CC: fields are OK.

Expected results:
Characters copied over as displayed in initial message.

This message can be further tweaked by changing its charset, and the charset used for the reply can be tweaked in Options/Preferences.  I haven't found a combination that preserves either the To: or Subject: header text.
Comment 2 Magnus Melin 2007-06-07 09:41:16 PDT
On linux the reply subject becomes only "Re: ". (Tried todays tb2.0 build)
Comment 3 Magnus Melin 2008-06-08 22:21:40 PDT
*** Bug 437307 has been marked as a duplicate of this bug. ***
Comment 4 Mark Sapiro 2008-10-03 17:37:06 PDT
Created attachment 341712 [details]
utf-8 QP encoded From; utf-8 body has problem

This is another manifestation of what appears to be this bug in T'Bird This simple .eml file has a From: header which is utf-8 quoted-printable encoded and a message body which is utf-8 encoded. When t2.eml is opened in T'Bird, the From and message body display properly, but upon Reply, the To: and ...wrote: in the composition window are garbled.
Comment 5 Mark Sapiro 2008-10-03 17:41:17 PDT
Created attachment 341714 [details]
utf-8 QP encoded From; iso-8859-1 body - no problem

This message is identical to the attached t2.eml except that the body is iso-8859-1 encoded instead of utf-8 encoded. This message doesn't exhibit the problem.
Comment 6 Wayne Mery (:wsmwk, NI for questions) 2009-05-31 11:04:01 PDT
reply using TB trunk

To: field looks good
subject jibberish
Comment 7 Mike Cowperthwaite 2009-05-31 11:36:34 PDT
I see that as well.

Mark Sapiro's problem (a different bug) also WFM in trunk.
Comment 8 WADA 2009-09-13 19:11:02 PDT
*** Bug 485800 has been marked as a duplicate of this bug. ***
Comment 9 Hiroyuki Ikezoe (:hiro) 2012-01-13 19:20:26 PST
Created attachment 588589 [details] [diff] [review]
Proposed fix

nsDummyMsgHeader in mail/base/content/msgHdrViewOverlay.js stores 'subject' as decoded text. So decoding the subject in nsMsgCompose::CreateMessage is not needed.

I will post a test for this issue later.
Comment 10 Hiroyuki Ikezoe (:hiro) 2012-01-15 21:58:01 PST
Created attachment 588809 [details] [diff] [review]
The test

The subject in the test is '∀a∊A'.
Comment 11 David :Bienvenu 2012-02-15 11:58:52 PST
Comment on attachment 588809 [details] [diff] [review]
The test

thx very much for the patch, r=me, but a couple nits:

+ * Test that MIME encoded subject is decoded when replying an opened .eml.
+ */
+function test_replay_eml_subject() {

typo: should be reply_eml_subject, not replay

and the comment should be

"when replying to an opened .eml file"
Comment 12 David :Bienvenu 2012-02-15 11:59:19 PST
Comment on attachment 588589 [details] [diff] [review]
Proposed fix

thx for the patch and test!
Comment 13 Hiroyuki Ikezoe (:hiro) 2012-02-15 15:19:58 PST
Created attachment 597581 [details] [diff] [review]
Revised test

carrying over review+.

Note You need to log in before you can comment on or make changes to this bug.