browse by category or date

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

nano-gitlab-environment

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!

GD Star Rating
loading...
Configuring GitLab to Use MS Exchange's SMTP Server, 3.0 out of 5 based on 1 rating

Possibly relevant:

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Incoming Search

email, git, gitlab, linux, ruby, smtp

No Comment

Add Your Comment