Project

General

Profile

Actions

Defect #21742

closed

Received text attachments doesn't hold the original encoding on Ruby >= 2.1

Added by Pavel Rosický almost 9 years ago. Updated over 8 years ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

Hello,
if I send an email with .txt file encoded in ISO 8859-2, it's received from the mailbox and saved to /files, but the encoding is different (some characters are lost). I think this is originaly caused by the utf-8 header added by email clients. In my opinion attachments shouln't be reencoded. Am I missed somethig?

Attached patch fixes the issue.

Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: base64

Environment:
  Redmine version                3.2.0.devel.15058
  Ruby version                   2.1.5-p273 (2014-11-13) [i386-mingw32]
  Rails version                  4.2.5
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.13
  Git                            1.9.5
  Filesystem
Redmine plugins:
  no plugin installed

Files

mail_handler.rb.patch (639 Bytes) mail_handler.rb.patch Pavel Rosický, 2016-01-17 18:15
mail_handler_test.rb.patch (1.15 KB) mail_handler_test.rb.patch Pavel Rosický, 2016-01-18 11:55
ticket_with_text_attachment_iso-8859-2.eml.patch (1.2 KB) ticket_with_text_attachment_iso-8859-2.eml.patch Pavel Rosický, 2016-01-18 11:56
original.txt (19 Bytes) original.txt Pavel Rosický, 2016-02-08 10:46
encoded.txt (12 Bytes) encoded.txt Pavel Rosický, 2016-02-08 10:46
Actions

Also available in: Atom PDF