aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-11-05 16:36:21 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-11-05 16:36:21 -0800
commit874446cd72f9edac60deb8dcd91cf2f019b5347c (patch)
tree6f91b3f33f8e557e46b0986f1275a30506bc1832 /app
parent152a442b1902050265ddcef56f5506b3bfbb12e4 (diff)
downloadrails-874446cd72f9edac60deb8dcd91cf2f019b5347c.tar.gz
rails-874446cd72f9edac60deb8dcd91cf2f019b5347c.tar.bz2
rails-874446cd72f9edac60deb8dcd91cf2f019b5347c.zip
Extract Mail-bound methods into mail_ext for future upstream work
Diffstat (limited to 'app')
-rw-r--r--app/models/action_mailbox/inbound_email.rb6
-rw-r--r--app/models/action_mailbox/inbound_email/message_id.rb2
2 files changed, 2 insertions, 6 deletions
diff --git a/app/models/action_mailbox/inbound_email.rb b/app/models/action_mailbox/inbound_email.rb
index 7d1a36b705..ea564a254e 100644
--- a/app/models/action_mailbox/inbound_email.rb
+++ b/app/models/action_mailbox/inbound_email.rb
@@ -8,12 +8,8 @@ class ActionMailbox::InboundEmail < ActiveRecord::Base
has_one_attached :raw_email
enum status: %i[ pending processing delivered failed bounced ]
- def self.mail_from_source(source)
- Mail.new Mail::Utilities.binary_unsafe_to_crlf(source.to_s)
- end
-
def mail
- @mail ||= self.class.mail_from_source(source)
+ @mail ||= Mail.from_source(source)
end
def source
diff --git a/app/models/action_mailbox/inbound_email/message_id.rb b/app/models/action_mailbox/inbound_email/message_id.rb
index 5cfcadaba1..70d39d1e33 100644
--- a/app/models/action_mailbox/inbound_email/message_id.rb
+++ b/app/models/action_mailbox/inbound_email/message_id.rb
@@ -14,7 +14,7 @@ module ActionMailbox::InboundEmail::MessageId
private
def extract_message_id(source)
- mail_from_source(source).message_id
+ Mail.from_source(source).message_id
rescue => e
# FIXME: Add logging with "Couldn't extract Message ID, so will generating a new random ID instead"
end