Closed Bug 844612 Opened 13 years ago Closed 13 years ago

Quoted printable subject decoded wrong(RFC2047 encoded word in message header is broken by bad application which produces 0x20/"=" for continuation in RFC2047 encoded word, RFC2047 encoded word longer than length lmitation of RFC2047 encoded word)

Categories

(MailNews Core :: MIME, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: adamone, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 Build ID: 20130218103317 Steps to reproduce: I received a newsletter. Actual results: The subject of the email is quoted printable encoded. The subject appeared in encoded format in the list of my inbox as well as on the top of full screen view of the email: =?utf-8?Q?Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9szeti=20Klub=20a=20Bem6-ban=20ma= =20este?= I use Thunderbird v17.0.2 User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 The full source code of the email is attached. Expected results: The subject should be seen in decoded format
(In reply to Adam Fónagy from comment #0) > Actual results: > The subject of the email is quoted printable encoded. (snip) Subject header. > Subject: =?utf-8?Q?Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9szeti=20Klub=20a=20Bem6-ban=20ma= =20este?= Where can we see "Subject text of RFC2047 encoded with quoted printable" in the header? Even if quoted-printable itself permits "space"(binary of 0x20, not 7bits-ascii string of =20) and/or = for continued line in quoted-printable encoded text in mail data, IIRC, RFC2047 encoded atom can't have space(0x20, not 7bits-ascii string of =20) nor = for continuation in an RFC2047 encoded atom.
http://tools.ietf.org/html/rfc2047#section-2 states: > > IMPORTANT: 'encoded-word's are designed to be recognized as 'atom's > by an RFC 822 parser. As a consequence, unencoded white space > characters (such as SPACE and HTAB) are FORBIDDEN within an > 'encoded-word'. For example, the character sequence > > =?iso-8859-1?q?this is some text?= > > would be parsed as four 'atom's, rather than as a single 'atom' (by > an RFC 822 parser) or 'encoded-word' (by a parser which understands > 'encoded-words'). The correct way to encode the string "this is some > text" is to encode the SPACE characters as well, e.g. > > =?iso-8859-1?q?this=20is=20some=20text?= Thus, the "=20ma= =20" part definitely looks wrong to me with the space there.
Component: Untriaged → MIME
Product: Thunderbird → MailNews Core
Bug opener, please distinguish followings. ([CRLF]==0x0D0A, [SP]==0x20) (1) Your case, Subject: header, not quoted-printable text > Subject: =?utf-8?Q?Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9szeti=20Klub=20a=20Bem6-ban=20ma=[SP]=20este?=[CRLF] (2) A variant of (1) > Subject: =?utf-8?Q?Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9szeti=20Klub=20a=20Bem6-ban=20ma=[CRLF] [SP]=20este?=[CRLF] (3) quoted-printable text > Content-Type: text/plain > Content-Transfer-Encoding: quoted-printable > > Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9szeti=20Klub=20a=20Bem6-ban=20ma=[CRLF] > =20este[CRLF] (4) a variant of (3), perhaps OK > Content-Type: text/plain > Content-Transfer-Encoding: quoted-printable > > Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9szeti=20Klub=20a=20Bem6-ban=20ma=[SP][CRLF] > =20este[CRLF] (5) another variant of (3), perhaps OK > Content-Type: text/plain > Content-Transfer-Encoding: quoted-printable > > Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9szeti=20Klub=20a=20Bem6-ban=20ma=[CRLF] > [SP]=20este[CRLF] (5) An example of correct RFC2047-with-quoted-printable encoded Subject: header > Subject: =?utf-8?Q?Regej=C3=A1r=C3=B3=20Misztr=C3=A1l=20M=C5=B1v=C3=A9?=[CRLF] > [SP]=?utf-8?Q?szeti=20Klub=20a=20Bem6-ban=20ma=20este?=[CRLF] Casual Web application programmer perhaps wrongly used function for text of (3) to Subject: header, without any reading or understanding mail related RFCs. Thus, he broke message header by (i) 0x20 in RFC2047 encoded word, (ii) = for continuation in RFC2047-quoted-printable encoded word, (iii) longer RFC2047 encoded word than permitted limit of 75 bytes. Anyway, INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Summary: Quoted printable subject decoded wrong → Quoted printable subject decoded wrong(RFC2047 encoded word in message header is broken by bad application which produces 0x20/"=" for continuation in RFC2047 encoded word, RFC2047 encoded word longer than length lmitation of RFC2047 encoded word)
finally I followed rsx11m's suggestion and is solved the my problem. Thank you, Adam
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: