Opened 7 years ago

Closed 5 years ago

#508 closed defect (fixed)

Susimail encoding issues

Reported by: zzz Owned by: zzz
Priority: major Milestone: 0.9.13
Component: apps/susimail Version: 0.8.7
Keywords: Cc:
Parent Tickets:

Description

HTML Page encoding set to UTF-8 just before the 0.8.8 release, so that translated strings are now rendered properly.

But it appears that mails generated by susimail set the encoding to ISO-8859-1.

Not clear if it honors the encoding in received mails or not.

Subtickets

Attachments (2)

508.diff (4.8 KB) - added by wockenfuss 5 years ago.
diff relative to apps/susimail/src/src/
508-applied.diff (9.9 KB) - added by str4d 5 years ago.
wockenfuss's 508.diff applied to trunk and "mtn diff"-ed

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by zzz

  • Milestone changed from 0.8.9 to 0.9

comment:2 Changed 7 years ago by slow

JFYI: i saw reports from russian guys that susimail breaks the encoding.

comment:3 Changed 6 years ago by str4d

  • Milestone 0.9 deleted

comment:4 Changed 5 years ago by str4d

  • Status changed from new to infoneeded_new

I loaded up susimail, and looked at a received message (sent by Trac), and the HTML page encoding on the login, mail-list and mail-view pages were all UTF-8.

Is this still a problem? How can the problem be recreated? Is it a problem with the encoding of received messages that were sent by susimail? The HTML page encoding being changed by susimail?

Changed 5 years ago by wockenfuss

diff relative to apps/susimail/src/src/

comment:5 Changed 5 years ago by wockenfuss

  • Status changed from infoneeded_new to new
  • replaced all instances of ISO-8859-1 with UTF-8
  • fixed some issues in the classes handling the quoted printable transfer encoding

-> sending / receiving utf-8 mails even in russian does now work, diff is attached

Changed 5 years ago by str4d

wockenfuss's 508.diff applied to trunk and "mtn diff"-ed

comment:6 Changed 5 years ago by str4d

  • Milestone set to 0.9.10
  • Resolution set to fixed
  • Status changed from new to closed

Patch looks good. Tested and I can send Russian text between mail.i2p addresses with susimail.

Merged in fb5bd0307a9ae9ec20dbd4dbfd244348660f56ed (thanks wockenfuss!)

comment:7 Changed 5 years ago by zzz

  • Milestone changed from 0.9.10 to 0.9.13
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening due to corrupted non-UTF-8 encoded headers (from, to, subject).

The Mail.java portion of the patch (line 178) changed the decoding of these lines from ISO-8859-1 to UTF-8. However these lines should be in encoded-word format:

http://en.wikipedia.org/wiki/MIME#Encoded-Word
http://tools.ietf.org/html/rfc2047

With the charset specified between the first two '?' ... The form is: "=?charset?encoding?encoded text?=".

But HeaderLine?.decode() ignores the charset parameter at about line 170 - f2 is incremented to skip to the second '?'.

The fix is a challenge because Mail.parseHeaders() assumes UTF-8 encoding across the entire ReadBuffer? (encompassing all headers). So HeaderLine?.decode at line ~200 must decode from the specified charset (if found in the JVM) and reencode back to UTF-8 bytes.

comment:8 Changed 5 years ago by zzz

Sample headers (Russian spam)

Subject: =?windows-1251?B?zvLi5fIg7eAg4uD4IOfg7/Du8TogwuD44CDk?=

=?windows-1251?B?7vXu5CDh8+Tl8iDx7vHy4OLrL8IDY1IDAw?=
=?windows-1251?B?MCDw8+Hr5ekg4iDt5eTl6/4u?=

From: =?windows-1251?B?zejq7uvg6SDN7uLo6u7i?= <(removed)@mail.ru>

comment:9 Changed 5 years ago by zzz

  • Owner set to zzz
  • Status changed from reopened to accepted

started

comment:10 Changed 5 years ago by zzz

  • Status changed from accepted to testing

Fixed in ba82e9e4c57bd8d9f567c9252fe7b5815972e370 0.9.12-6

comment:11 Changed 5 years ago by zzz

There were more problems on the creation side, when the platform encoding was not UTF-8, as reported by cryptosynthesis.

Hopefully fixed in 0.9.12-9 921c427d38e6930d45df3761da86aa511820d521

comment:12 Changed 5 years ago by zzz

  • Resolution set to fixed
  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.