aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-05-22 13:47:01 +0100
committerMark Longair <mhl@pobox.com>2013-05-22 13:58:14 +0100
commit1a75c4f35f0dd7ea3598a3bfa467bcedc5474faa (patch)
tree35e6b67288b325afeff5dcbc33358e31cf78a6aa
parent6e64eb8fd3a346c24990553f294fb9d1f0ae6bbc (diff)
Move the mapi requires to where they're really needed
Handling of outlook-packed attachments would fail from rake tasks or in the console without requiring 'mapi/msg' and 'mapi/convert' beforehand. Instead, require them in the source file where they're actually used.
-rw-r--r--app/models/incoming_message.rb2
-rw-r--r--lib/mail_handler/backends/mail_backend.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 64afe6e3e..e5ccf1498 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -34,8 +34,6 @@
require 'htmlentities'
require 'rexml/document'
require 'zip/zip'
-require 'mapi/msg'
-require 'mapi/convert'
require 'iconv' unless RUBY_VERSION >= '1.9'
class IncomingMessage < ActiveRecord::Base
diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb
index 42180dd6f..03d78e0a3 100644
--- a/lib/mail_handler/backends/mail_backend.rb
+++ b/lib/mail_handler/backends/mail_backend.rb
@@ -1,4 +1,6 @@
require 'mail'
+require 'mapi/msg'
+require 'mapi/convert'
module Mail
class Message