Permalink
Browse files

Use Mail.read instead of Mail.new

  • Loading branch information...
peterkeen committed Jul 10, 2012
1 parent a00ffc0 commit 435d348843f704d94a6878cb951c5d320492226b
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/speedee/app.rb
View
@@ -114,12 +114,12 @@ def flatten_replies(root_message)
end
def format_message(message)
- mail_msg = Mail.new(message.filename)
+ mail_msg = Mail.read(message.filename)
{
from: message['From'],
to: message['To'],
date: message.date,
- body: mail_msg.body.to_s.gsub("\n", "<br>").encode('UTF-8', invalid: :replace, :undef => :replace, replace: ''),
+ body: mail_msg.body.decoded.encode('UTF-8', :replace => '', :invalid => :replace, :undef => :replace).gsub("\n", "<br>"),
id: message.message_id
}
end

0 comments on commit 435d348

Please sign in to comment.