Defect #18977

UTF-8 encoded subject extracted from email

Added by Andrey Ni over 6 years ago. Updated over 6 years ago.

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


Category:Email receiving
Target version:-
Resolution:Duplicate Affected version:2.6.0


When issue is created from email and email subject consist of multiple lines encoded in base64 only the first line of the subject is shown in 'Issues'.

It happens because of collapse_adjacent_encodings function.
I don't know Ruby so I can not explain exactly what is wrong with the code, but I do know that 2 lines like this
can NOT be joined together as commentary to the function says.
Cause if you try to decode from base64 concatenation of this strings the result will be decoded first string, not the concatenation of decoded first and second strings (decode(str1+str2)=decode(str1) and decode(str1+str2)!=decode(str1)+decode(str2) as you would assume). I believe it's because the base64 decoding function ignores everything after '=' symbol. ('=' or '==' in base64 strings are added when last octet decodes to 2 or 1 bytes correspondingly)

Redmine version 2.6.0.stable
Ruby version 2.0.0-p598 (2014-11-13) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter Mysql2

Related issues

Duplicates Redmine - Defect #16859: rdm-mailhandler: subject corruption Closed


#1 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Duplicate of #16859.

#2 Updated by Toshi MARUYAMA over 6 years ago

  • Duplicates Defect #16859: rdm-mailhandler: subject corruption added

Also available in: Atom PDF