andyedinborough / aenetmail

C# POP/IMAP Mail Client
370 stars 153 forks source link

Underscores in encoded Subject header #52

Closed nakhli closed 12 years ago

nakhli commented 12 years ago

Hi,

Encoded Subject header uses _ in some clients to encode spaces. This case is not handled properly. Examples:

Case1

Subject: =?iso-8859-1?Q?testing_encoding_h=E9?= Got: testing_encoding_hé Expected: testing encoding hé

Case2

Subject: coucou =?ISO-8859-1?Q?=E0_tous?= Got: coucou à_tous Expected: coucou à tous

Thanks

andyedinborough commented 12 years ago

Can you forward me an example of the entire message? Specifically, I'm looking to see if it has a reference to RFC 1342.

Andy

-----Original Message----- From: Chaker [mailto:reply@reply.github.com] Sent: Thursday, March 15, 2012 12:08 PM To: Andy Edinborough Subject: [aenetmail] Underscores in encoded Subject header (#52)

Hi,

Encoded Subject header uses _ in some clients to encode spaces. This case is not handled properly. Examples:

Case1

Subject: =?iso-8859-1?Q?testing_encoding_h=E9?= Got: testing_encoding_hé Expected: testing encoding hé

Case2

Subject: coucou =?ISO-8859-1?Q?=E0_tous?= Got: coucou à_tous Expected: coucou à tous

Thanks


Reply to this email directly or view it on GitHub: https://github.com/andyedinborough/aenetmail/issues/52

nakhli commented 12 years ago
Return-path: <andy@example.com>
Envelope-to: joe@example.com
Delivery-date: Thu, 15 Mar 2012 08:30:38 -0600
Received: from [80.00.00.48] (helo=[192.00.00.131])
    by box508.example.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
    (Exim 4.76)
    (envelope-from <andy@example.com>)
    id 1S8BhO-0007sY-3j
    for joe@example.com; Thu, 15 Mar 2012 08:30:38 -0600
Message-ID: <4F61FD0C.2050509@example.com>
Date: Thu, 15 Mar 2012 15:30:36 +0100
From: Andy <andy@example.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: joe@example.com
Subject: coucou =?ISO-8859-1?Q?=E0_tous?=
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Identified-User: {835:box508.example.com:xxxx:example.com} {sentby:smtp auth 80.00.00.48 authed with andy@example.com}

hé à
andyedinborough commented 12 years ago

Thanks! Can you send me an example now where there's an underscore in the subject (but no spaces)?

htoma commented 12 years ago

Hi Andy,

I think this corresponds to #case 1

andyedinborough commented 12 years ago

Sorry, I meant where an underscore is expected, but spaces aren't.

nakhli commented 12 years ago

The underscore is encoded. Here is an example:

Subject: =?iso-8859-1?Q?h=E9llo=5Fthere?=
To: "joe@example.com" <joe@example.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="-294336953-1535390948-1331488664=:74297"

---294336953-1535390948-1331488664=:74297
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

=0A
---294336953-1535390948-1331488664=:74297
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"color:#000; background-color:#fff; font-family:ar=
ial, helvetica, sans-serif;font-size:10pt"><div></div></div></body></html>
---294336953-1535390948-1331488664=:74297--

The result is ok:

Expected: héllo_there Got: héllo_there