diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-08 12:09:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-08 12:09:42 +0300 |
commit | f4ea1f8998fd64bcd02280514b91f103f830d5ce (patch) | |
tree | 14ff4a76b07da90dbaa9c75398b3bd2a79ac85c6 /lib/gitlab/email | |
parent | ae192a2f1410b5f71397a64df76238b9d3b0afbe (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/email')
-rw-r--r-- | lib/gitlab/email/receiver.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/gitlab/email/receiver.rb b/lib/gitlab/email/receiver.rb index 6d3e954f449..8b0f3d7cf24 100644 --- a/lib/gitlab/email/receiver.rb +++ b/lib/gitlab/email/receiver.rb @@ -32,8 +32,8 @@ module Gitlab def mail_metadata { mail_uid: mail.message_id, - from_address: mail.from, - to_address: mail.to, + from_address: from, + to_address: to, mail_key: mail_key, references: Array(mail.references), delivered_to: delivered_to.map(&:value), @@ -42,7 +42,7 @@ module Gitlab # reduced down to what looks like an email in the received headers received_recipients: recipients_from_received_headers, meta: { - client_id: "email/#{mail.from.first}", + client_id: "email/#{from.first}", project: handler&.project&.full_path } } @@ -78,7 +78,7 @@ module Gitlab end def key_from_to_header - mail.to.find do |address| + to.find do |address| key = email_class.key_from_address(address) break key if key end @@ -112,6 +112,14 @@ module Gitlab end end + def from + Array(mail.from) + end + + def to + Array(mail.to) + end + def delivered_to Array(mail[:delivered_to]) end |