Defect #34831

Unnecessary encoded CR characters in mails

Added by Albrecht Dreß almost 2 years ago. Updated about 1 year ago.

Status:ResolvedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Category:Email notifications
Target version:-
Resolution: Affected version:4.0.7


I noticed that Redmine adds unnecessary CR (0x0d) characters to mail texts which may confuse some MUA's, e.g. (note the qp encoded “=0D”, not to be confused with the regular CRLF line endings required by RFC 5322, indicated by “\r”):

Content-Type: text/plain;\r
Content-Transfer-Encoding: quoted-printable\r
Ticket #3814 wurde erstellt von Albrecht Dre=C3=9F.=0D\r
Feature #3814: Diskussion=0D\r\r
* Autor: Albrecht Dre=C3=9F=0D\r

Is it possible to get rid of them? Where should I look in the sources? I run Redmine 4.0.7 on a Debian Buster system, installed from Debian Backports.


#1 Updated by Pavel Rosický almost 2 years ago

sources are here it's a dependency of Redmine.

The result looks buggy to me, but there was no release in 3 years, so I wouldn't expect much even if you have a fix.

#2 Updated by Albrecht Dreß about 1 year ago

  • Status changed from New to Resolved

Sorry for the late reply – I meanwhile found time to dig into this issue, and it appears that it's actually related to mail issue 1325. The issue seems to occur only if the message body contains non-ASCII characters (e.g. German “Umlaut” chars like ä). The ruby-mail version (on Debian Buster) is 2.7.1.

Simply creating the file /usr/share/redmine/config/initializers/99_fix_mail_crlf.rb containing

module Mail
  module Encodings
    class QuotedPrintable < SevenBit
      def self.encode(str)

and restarting Apache results in properly formatted messages for me (afaict).

Also available in: Atom PDF