diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2018-12-19 18:30:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-19 18:30:10 +0100 |
commit | 83312db72d6f9798a505d657b450f2f6693d048c (patch) | |
tree | 5b12b4109fb2fa72631764bcc043818fab9c69d8 | |
parent | 849f2b6634074d32ab35e4537f9f2852d5052e80 (diff) | |
parent | 0298725f0269cf2fffb723200d21f21ed3a7de64 (diff) | |
download | rails-83312db72d6f9798a505d657b450f2f6693d048c.tar.gz rails-83312db72d6f9798a505d657b450f2f6693d048c.tar.bz2 rails-83312db72d6f9798a505d657b450f2f6693d048c.zip |
Merge pull request #12 from dixpac/add_logger_when_auto_generating_message_id
Added logging when Message ID wasn't extracted
-rw-r--r-- | app/models/action_mailbox/inbound_email/message_id.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/action_mailbox/inbound_email/message_id.rb b/app/models/action_mailbox/inbound_email/message_id.rb index 4807a2a293..f10f59ea45 100644 --- a/app/models/action_mailbox/inbound_email/message_id.rb +++ b/app/models/action_mailbox/inbound_email/message_id.rb @@ -25,14 +25,14 @@ module ActionMailbox::InboundEmail::MessageId private def extract_message_id(source) - 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" + Mail.from_source(source).message_id rescue nil end end private def generate_missing_message_id - self.message_id ||= Mail::MessageIdField.new.message_id + self.message_id ||= Mail::MessageIdField.new.message_id.tap do |message_id| + logger.warn "Message-ID couldn't be parsed or is missing. Generated a new Message-ID: #{message_id}" + end end end |