Project

General

Profile

Actions

Defect #13135

open

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

Added by Timothy Fawcett about 11 years ago. Updated about 11 years ago.

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

0%

Estimated time:
Resolution:
Affected version:

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
Actions #1

Updated by Timothy Fawcett about 11 years ago

Possible fix - remove LEADING space by:

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

Also available in: Atom PDF