Skip to content
Snippets Groups Projects
Commit 32eae15f authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

It's for Message-ID so it should be message_id

parent c2bc15a7
No related branches found
No related tags found
1 merge request!3363Implement #3243 New Issue by email
Loading
Loading
@@ -60,7 +60,7 @@ module Gitlab
 
def key_from_additional_headers
Array(mail.references).find do |mail_id|
key = Gitlab::IncomingEmail.key_from_fallback_reply_mail_id(mail_id)
key = Gitlab::IncomingEmail.key_from_fallback_message_id(mail_id)
break key if key
end
end
Loading
Loading
module Gitlab
module IncomingEmail
class << self
FALLBACK_REPLY_MAIL_ID_REGEX = /\Areply\-(.+)@#{Gitlab.config.gitlab.host}\Z/.freeze
FALLBACK_MESSAGE_ID_REGEX = /\Areply\-(.+)@#{Gitlab.config.gitlab.host}\Z/.freeze
 
def enabled?
config.enabled && config.address
Loading
Loading
@@ -21,8 +21,8 @@ module Gitlab
match[1]
end
 
def key_from_fallback_reply_mail_id(mail_id)
match = mail_id.match(FALLBACK_REPLY_MAIL_ID_REGEX)
def key_from_fallback_message_id(mail_id)
match = mail_id.match(FALLBACK_MESSAGE_ID_REGEX)
return unless match
 
match[1]
Loading
Loading
Loading
Loading
@@ -43,9 +43,9 @@ describe Gitlab::IncomingEmail, lib: true do
end
end
 
context 'self.key_from_fallback_reply_mail_id' do
context 'self.key_from_fallback_message_id' do
it 'returns reply key' do
expect(described_class.key_from_fallback_reply_mail_id('reply-key@localhost')).to eq('key')
expect(described_class.key_from_fallback_message_id('reply-key@localhost')).to eq('key')
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment