Defect #19576

Ticket subject.strip in recent version not in an old one

Added by Shigeru Wakita over 6 years ago. Updated over 6 years ago.

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

0%

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

Description

Hi,

I finally upgraded Redmine from 1.3.1 to 2.6.3 and found one problem; this did not happen at an old version [1.3.1] but happens recent one [2.6.3].

RedmineReceivingEmails works fine as long as the subject is short. However, the problem is subject.strip works occasionally (not always), if the subject gets longer and/or contains both English and Japanese characters. (This might be similar one to #18170.)

I could avoid this editing app/models/mail_handler.rb using this methods , but doing this at every upgrade time is annoying.

Followings are excerption of mail_handler.rb of each versions around issue.subject.
  • Redmine 1.3.1 + Ruby 1.8.7 + Rails 3.2.8 [Problem NOT happened]
        issue.subject = email.subject.to_s.chomp[0,255]
    
  • Redmine 2.6.3 + Ruby 2.1.5 + Rails 3.2.21 [Problem happens]
        issue.subject = cleaned_up_subject
    
      def cleaned_up_subject
        subject = email.subject.to_s
        subject.strip[0,255]
      end
    

    NOTE: changing from strip to chomp could not solve the problem

I would like to clarify why this happens in resent version [2.6.1] but not in old one [1.3.1], and hope this will be fixed in up-coming version.
If I misunderstood anything, please tell me.

Thanks in advance.


Related issues

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

History

#1 Updated by Jean-Philippe Lang over 6 years ago

  • Status changed from New to Needs feedback

Sorry, I don't get what the actual problem is. Could you provide an exemple or maybe a patch that includes a test?

#2 Updated by Shigeru Wakita over 6 years ago

I would like to create a new issue with a subject as shown as it is in the email, but it occasionally fails.

Examples of such cases. Subject of the issue are not same as in email and ends unexpectedly.

Subject of the email sent to redmine イベントを検知しました:[試験][A1111111B] ABC Defghi Jklmnopqrstuv からのテスト・メッセージです。
Subject of the issue receiving email イベントを検知しました:[試験][A111111 ABC Defghi Jklmnopqrstuv からのテスト・メッ

ref. https://groups.google.com/forum/#!topic/redmine-users-ja/tV-aHSTHYtE

#3 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Duplicate

Duplicate of #16859.

"ABC Defghi Jklmnopqrstuv からのテスト・メッセージです。" is less than 255 on both of Ruby 1.8 and 1.9.
I think it is mail gem bug.

#4 Updated by Toshi MARUYAMA over 6 years ago

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

Also available in: Atom PDF