Opened 6 years ago

Closed 5 years ago

#1484565 closed Bugs (fixed)

bad charsets render message/subject invisible - should assume us-ascii at least

Reported by: memoryhole Owned by: thomasb
Priority: 5 Milestone: 0.1-stable
Component: MIME parsing Version: git-master
Severity: major Keywords:
Cc:

Description

If a message has a bad Content-Type encoding, roundcube gives up on rendering the message entirely. The message shows up in the message list with "(no subject)" as its subject (even though it may have a correctly encoded subject). When you try to view the message, the content of the message is missing.

I can repeatably demonstrate this by taking an ordinary email message with a Content-Type header and modifying it. For example, the following header makes the message unviewable:

Content-Type: TEXT/PLAIN; charset=X-UNKNOWN

If that header is changed to:

Content-Type: TEXT/PLAIN; charset=US-ASCII

Then suddenly it becomes viewable in roundcube again. This behavior is only true of the current SVN; it doesn't happen in 0.1-rc1. In that version of roundcube, messages with unrecognized charsets appear to be assumed to be US-ASCII, and they display well.

Unfortunately, some versions of pine and other webmails (e.g. squirrelmail) spit out these malformed emails.

Attachments (1)

roundcube-iconv-fix.patch (993 bytes) - added by memoryhole 6 years ago.
A patch that fixes the problem (with charset aliasing to fix typical mis-labelling)

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 years ago by thomasb

  • Milestone changed from 0.1-rc2 to 0.1.1

In case the charset specification is missing, we have a fallback to ISO-8859-1 but X-UNKNOWN might cause iconv to fail.

comment:2 Changed 6 years ago by memoryhole

The X-UNKNOWN header is often generated by pine when dealing with messages that were once utf-8 encoded. Squirrelmail has been known to generate the following header:

Content-Type: TEXT/PLAIN; charset=none

The best fallback, at least in the western world, is probably windows-1252 rather than ISO-8859-1 (aka latin1).

Changed 6 years ago by memoryhole

A patch that fixes the problem (with charset aliasing to fix typical mis-labelling)

comment:3 Changed 6 years ago by thomasb

  • Milestone changed from 0.1.1 to 0.1-stable
  • Owner set to thomasb
  • Status changed from new to assigned

comment:4 Changed 6 years ago by beni

I encountered a subject problem similar to the above.

The subject line:

Subject: Cron <root@hellforge>    nice -n 19 backup2l -b			# backup

caused roundcube svn to fail render the subject line, it was printed "(no subject)" instead.

I successfully applied the above mentioned patch to roundcube-svn REV 874 (which has main.inc REV 862) some minutes ago. This patch fixes my issue.

comment:5 Changed 5 years ago by thomasb

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [38b012e0]

Note: See TracTickets for help on using tickets.