aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mail_handler/backends/tmail_backend.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mail_handler/backends/tmail_backend.rb')
-rw-r--r--lib/mail_handler/backends/tmail_backend.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mail_handler/backends/tmail_backend.rb b/lib/mail_handler/backends/tmail_backend.rb
index ff00d92df..2f59b1161 100644
--- a/lib/mail_handler/backends/tmail_backend.rb
+++ b/lib/mail_handler/backends/tmail_backend.rb
@@ -17,13 +17,13 @@ module MailHandler
# Turn raw data into a structured TMail::Mail object
# Documentation at http://i.loveruby.net/en/projects/tmail/doc/
- def mail_from_raw_email(data)
+ def mail_from_raw_email(data, decode=true)
# Hack round bug in TMail's MIME decoding.
# Report of TMail bug:
# http://rubyforge.org/tracker/index.php?func=detail&aid=21810&group_id=4512&atid=17370
copy_of_raw_data = data.gsub(/; boundary=\s+"/im,'; boundary="')
mail = TMail::Mail.parse(copy_of_raw_data)
- mail.base64_decode
+ mail.base64_decode if decode
mail
end