diff options
author | David Padilla <david@easybroker.com> | 2016-02-29 23:29:20 -0600 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-03-25 13:05:15 +0100 |
commit | 31e76baf610e1307090a6bac3a7b3d525bce057a (patch) | |
tree | 6381eb0aa46cdfb646f93aaa1bfd7b8e5d881333 /lib | |
parent | 63c8a05bf7f18ac4093ece1f08b4b5fd8dba5fac (diff) | |
download | gitlab-ce-31e76baf610e1307090a6bac3a7b3d525bce057a.tar.gz |
Fix #2364. Fall back to In-Reply-To header when reply key not available
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/email/receiver.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/gitlab/email/receiver.rb b/lib/gitlab/email/receiver.rb index d4b6f6d120d..d55bacde5b0 100644 --- a/lib/gitlab/email/receiver.rb +++ b/lib/gitlab/email/receiver.rb @@ -63,6 +63,10 @@ module Gitlab end def reply_key + key_from_to_address || key_from_in_reply_to_header + end + + def key_from_to_address key = nil message.to.each do |address| key = Gitlab::IncomingEmail.key_from_address(address) @@ -72,6 +76,17 @@ module Gitlab key end + def key_from_in_reply_to_header + reply_key = nil + + message[:in_reply_to].message_ids.each do |message_id| + reply_key = Gitlab::IncomingEmail.key_from_address(message_id) + break if reply_key + end + + reply_key + end + def sent_notification return nil unless reply_key |