mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Added logging when Message ID wasn't extracted
This commit is contained in:
parent
849f2b6634
commit
0298725f02
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue