Project

General

Profile

Actions

Patch #15785

closed

Support more character encodings in incoming emails

Added by Felix Schäfer almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The MailHandler currently tries to convert the encoding of the body of incoming emails to UTF-8 by directly passing the charset of the email body to Redmine::CodesetUtil.to_utf8, see source:/trunk/app/models/mail_handler.rb@12473#L413. Redmine::CodesetUtil.to_utf8 in turn only handles encodings known to Ruby (on 1.9+), which might not be the case for the charset of an incoming email.

Planio recently had the case of a user sending emails in Korean with the charset ks_c_5601-1987, which Ruby doesn't know about. This can be mitigated thanks to Mail::RubyVer.pick_encoding which will try to pick a Ruby encoding compatible with the charset of the email (Mail::RubyVer is a wrapper for the correct functions for the current Ruby version).

I will post a patch for this shortly.


Files

15785.patch (2.2 KB) 15785.patch Felix Schäfer, 2013-12-30 11:33

Related issues

Related to Redmine - Patch #18047: MailHandler: Don't use String#respond_to?(:force_encoding) to differentiate between Ruby 1.8 and Ruby 1.9Closed

Actions
Actions

Also available in: Atom PDF