Defect #13135

mail_handler.rb - email message body has trailing space - alters wiki view

Added by Timothy Fawcett almost 10 years ago. Updated almost 10 years ago.

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

0%

Category:Email receiving
Target version:-
Resolution: Affected version:2.2.2

Description

Redmine 2.2.2, Ruby 1.8.7, Rails 3.2.11 on EL6

app/models/mail_handler.rb, line 475:

body.strip

This leaves a trailing space on all lines of the body of the email:

Testing, Testing

 2 new lines...  Still testing
 -- 
 *Me*
 Office: (555) 555-1212
 Email: me@example.net

Which looks like:

Testing, Testing

2 new lines...  Still testing
--
Me
Office: (555) 555-1212
Email:

Possible fix - remove trailing space by:

#body.strip
newbody = "" 
body.each {|l| newbody << l.gsub(/^[ ]/, '')}
body = newbody

History

#1 Updated by Timothy Fawcett almost 10 years ago

Possible fix - remove LEADING space by:

#body.strip
newbody = "" 
body.each {|l| newbody << l.gsub(/^[ ]/, '')}
body = newbody

Also available in: Atom PDF