From b1f236164e835a8d21bc19c343c9e211fdcb65b6 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Fri, 27 Jul 2018 14:10:18 +0200 Subject: Put fallback reply-key address first in the References header The References header is an ordered list of mails, and some clients only look at the last mail in the list to determine to which mail the mail is in reply to. Therefore, to be a less obtrusive as possible, put the fallback address first. Some info about the reply key lookup in the References header: https://docs.gitlab.com/ee/administration/reply_by_email.html#how-it-works --- app/mailers/notify.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/mailers') diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 1db1482d6b7..0e1e39501f5 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -124,7 +124,7 @@ class Notify < BaseMailer fallback_reply_message_id = "".freeze headers['References'] ||= [] - headers['References'] << fallback_reply_message_id + headers['References'].unshift(fallback_reply_message_id) @reply_by_email = true end @@ -158,7 +158,7 @@ class Notify < BaseMailer def mail_answer_thread(model, headers = {}) headers['Message-ID'] = "<#{SecureRandom.hex}@#{Gitlab.config.gitlab.host}>" headers['In-Reply-To'] = message_id(model) - headers['References'] = message_id(model) + headers['References'] = [message_id(model)] headers[:subject]&.prepend('Re: ') -- cgit v1.2.3