mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-09 04:36:11 +10:00
Fix Message-ID field to be RFC 2111-compliant to prevent e-mails from being dropped
Closes #2867
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
Please view this file on the master branch, on stable branches it's out of date.
|
||||
|
||||
v 8.0.4
|
||||
- Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu)
|
||||
|
||||
v 8.0.3
|
||||
- Fix URL shown in Slack notifications
|
||||
- Fix bug where projects would appear to be stuck in the forked import state (Stan Hu)
|
||||
|
||||
@@ -140,7 +140,7 @@ class Notify < BaseMailer
|
||||
# * have a 'In-Reply-To' or 'References' header that references the original 'Message-ID'
|
||||
#
|
||||
def mail_answer_thread(model, headers = {})
|
||||
headers['Message-ID'] = SecureRandom.hex
|
||||
headers['Message-ID'] = "<#{SecureRandom.hex}@#{Gitlab.config.gitlab.host}>"
|
||||
headers['In-Reply-To'] = message_id(model)
|
||||
headers['References'] = message_id(model)
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ describe Notify do
|
||||
end
|
||||
|
||||
it 'has headers that reference an existing thread' do
|
||||
is_expected.to have_header 'Message-ID', /<(.*)@#{Gitlab.config.gitlab.host}>/
|
||||
is_expected.to have_header 'References', /<#{thread_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/
|
||||
is_expected.to have_header 'In-Reply-To', /<#{thread_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/
|
||||
is_expected.to have_header 'X-GitLab-Project', /#{project.name}/
|
||||
|
||||
Reference in New Issue
Block a user