diff options
Diffstat (limited to 'lib/mail_handler')
-rw-r--r-- | lib/mail_handler/backends/mail_backend.rb | 4 | ||||
-rw-r--r-- | lib/mail_handler/backends/mail_extensions.rb | 8 | ||||
-rw-r--r-- | lib/mail_handler/mail_handler.rb | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index 89fc24bb9..5a7e0ef65 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -36,7 +36,7 @@ module MailHandler module Backends module MailBackend - def backend() + def backend 'Mail' end @@ -124,7 +124,7 @@ module MailHandler envelope_to = mail['envelope-to'] ? [mail['envelope-to'].value.to_s] : [] ((mail.to || []) + (mail.cc || []) + - (envelope_to || [])).uniq + (envelope_to || [])).compact.uniq end def empty_return_path?(mail) diff --git a/lib/mail_handler/backends/mail_extensions.rb b/lib/mail_handler/backends/mail_extensions.rb index 38997861c..b39e54d08 100644 --- a/lib/mail_handler/backends/mail_extensions.rb +++ b/lib/mail_handler/backends/mail_extensions.rb @@ -38,7 +38,7 @@ module Mail # Can be removed when we no longer support Ruby 1.8 class Ruby18 - def Ruby18.b_value_decode(str) + def self.b_value_decode(str) match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m) if match encoding = match[1] @@ -56,7 +56,7 @@ module Mail str end - def Ruby18.q_value_decode(str) + def self.q_value_decode(str) match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/m) if match encoding = match[1] @@ -76,7 +76,7 @@ module Mail private - def Ruby18.fix_encoding(encoding) + def self.fix_encoding(encoding) case encoding.upcase when 'UTF8' 'UTF-8' @@ -87,7 +87,7 @@ module Mail end class Ruby19 - def Ruby19.b_value_decode(str) + def self.b_value_decode(str) match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m) if match charset = match[1] diff --git a/lib/mail_handler/mail_handler.rb b/lib/mail_handler/mail_handler.rb index 0c60fd3f5..313869d16 100644 --- a/lib/mail_handler/mail_handler.rb +++ b/lib/mail_handler/mail_handler.rb @@ -134,7 +134,7 @@ module MailHandler begin zip_file = Zip::ZipFile.open(tempfile.path) text += get_attachment_text_from_zip_file(zip_file) - zip_file.close() + zip_file.close rescue $stderr.puts("Error processing zip file: #{$!.inspect}") end |