In my company we have GitLab 7.11 running on Ubuntu Ubuntu 14.04.1 LTS. Recently we found out that the email notifications wasn’t sent out. After confirming that the IP address is in the SMTP server’s sender whitelist, I began exploring GitLab’s mail configuration.
In GitLab’s installation folder, open config/environments/production.rb
. Find config.action_mailer.delivery_method and change its value to :smtp
Next, we need to create the smtp config file. Fortunately, GitLab has the sample config file. Run this command to create the config:
$ cp config/initializers/smtp_settings.rb.sample config/initializers/smtp_settings.rb
Now edit smtp_settings.rb
if Rails.env.production? Gitlab::Application.config.action_mailer.delivery_method = :smtp ActionMailer::Base.smtp_settings = { address: "email.server.com", port: 456, user_name: "smtp", password: "123456", domain: "gitlab.company.com", authentication: :login, enable_starttls_auto: true } end
Since my Exchange is using sender whitelist with no authentication required, my config is very simple:
if Rails.env.production? Gitlab::Application.config.action_mailer.delivery_method = :smtp ActionMailer::Base.smtp_settings = { address: "192.168.1.200", # My SMTP IP Address port: 25 } end
After saving the config, restart both GitLab and Nginx
$ sudo service gitlab restart $ sudo service nginx restart
Lastly, test whether the notification out by remove, then add back user to a project. At any case that the email delivery failed, you can view the error message at GitLab’s Admin Area – Background Jobs.
Oh, and if you need for more information on the SMTP configuration, you can refer to this documentation.
I hope it helps, cheers!
loading...
About Hardono
Incoming Search
email, git, gitlab, linux, ruby, smtp