Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/email/receiver.rb')
-rw-r--r--lib/gitlab/email/receiver.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/email/receiver.rb b/lib/gitlab/email/receiver.rb
index bf6c28b9f90..f5e47b43a9a 100644
--- a/lib/gitlab/email/receiver.rb
+++ b/lib/gitlab/email/receiver.rb
@@ -54,7 +54,8 @@ module Gitlab
def key_from_additional_headers(mail)
find_key_from_references(mail) ||
find_key_from_delivered_to_header(mail) ||
- find_key_from_envelope_to_header(mail)
+ find_key_from_envelope_to_header(mail) ||
+ find_key_from_x_envelope_to_header(mail)
end
def ensure_references_array(references)
@@ -91,6 +92,13 @@ module Gitlab
end
end
+ def find_key_from_x_envelope_to_header(mail)
+ Array(mail[:x_envelope_to]).find do |header|
+ key = Gitlab::IncomingEmail.key_from_address(header.value)
+ break key if key
+ end
+ end
+
def ignore_auto_reply!(mail)
if auto_submitted?(mail) || auto_replied?(mail)
raise AutoGeneratedEmailError