From 24a8cb1e5600d95a51323982e4d7508eb22c8b1f Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Thu, 30 Jun 2005 21:40:43 +0000 Subject: Normalize line endings in outgoing mail bodies to "\n" #1536 [John Long] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/lib/action_mailer/vendor/tmail/mail.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionmailer/lib/action_mailer/vendor') diff --git a/actionmailer/lib/action_mailer/vendor/tmail/mail.rb b/actionmailer/lib/action_mailer/vendor/tmail/mail.rb index 9111a65042..f4a42df19b 100755 --- a/actionmailer/lib/action_mailer/vendor/tmail/mail.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail/mail.rb @@ -335,9 +335,13 @@ module TMail } end + def normalize_line_endings(text) + text.to_s.gsub(/\r\n?/, "\n") + end + def body=( str ) parse_body - @body_port.wopen {|f| f.write str } + @body_port.wopen {|f| f.write normalize_line_endings(str) } str end -- cgit v1.2.3