inconsistent Domain name in Message-ID with stmp configuration.
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
I've installed a gitlab ce version 8.9.5 revsion gitlab-ce@f6ab19d6506a10584b09455a6202e54efaacfa17 on a Ubuntu 14 server. I've configed stmp with the following code in /etc/gitlab/gitlab.rb
file.
Since I'm using zoho mail as my email provider, I wrote my own config according to the example here.
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.zoho.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "account@zoho.com"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_domain'] = "smtp.zoho.com"
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true
Then I executed sudo gitlab-ctl reconfigure
, everything looks fine, no errors occurred.
For testing reasons, I do a password recovery where gitlab will send me an email. But nothing arrives in my inbox.
Weird thing happens when, after about 1 or 2 hours, I receive the mail in the receiver's inbox and a delay warning(Mail Delivery Status Notification (Delay)
) in the sender's inbox.
First, for your convenience and my privacy, let's say my Ubuntu hostname is testserver
which is stored in /etc/hostname
.
I look through the notification and figure out:
the message ID in mail header is something like some-hash-gibberish@testserver.mail
. I don't know much about the email sending procedures, but I'm pretty sure that the domain should be zoho.com since I send a mail from thunderbird using the same sender address and check the header where I find some-hash-gibberish@zoho.com
. It's really possible that the wrong domain in message ID delays the delivery.
To look deeper into the issue, I follow the instruction on this page.
After some config checks, I successfully send an email by Notify.test_email('youremail@email.com', 'Hello World', 'This is a test message').deliver_now
.
The output contains the mail header in the end and says <Message-ID: <some-hash-gibberish@testserver.mail>>
.
Then I do some google search and find this page.
In file app/mailers/notify.rb
headers['Message-ID'] = "<#{SecureRandom.hex}@#{Gitlab.config.gitlab.host}>"
In file spec/mailers/notify_spec.rb
is_expected.to have_header 'Message-ID', /<(.*)@#{Gitlab.config.gitlab.host}>/
These 2 lines of code confirms my uneducated guess that the domain is your local server name.
So, is it a bug or can I config it somewhere in gitlab configuration files so that Gitlab.config.gitlab.host
is zoho.com
?
I also assume 3 solutions:
-
It's hopefully a bug. Fix it and I'm good to go.
-
It's a configuration I missed, please tell me where to change.
-
No solution for now. Just do a workaround: hardcode the domain name in the those 2 files above.