Do i have to install postfix on my omnibus-gitlab in order to send mails through gmail?

May 5, 2016 417 views
Git Linux Basics Ubuntu 16.04

Hello!! I installed Gitlab CE Omnibus Package on Ubuntu 16.04 droplet. Im a newbie in all respects on mail and smtp. On the gitlab page it says that you can configure Gmail by editing the /etc/gitlab/gitlab.rb file with this:

 gitlab_rails['smtp_enable'] = true
 gitlab_rails['smtp_address'] = ""
 gitlab_rails['smtp_port'] = 587
 gitlab_rails['smtp_user_name'] = ""
 gitlab_rails['smtp_password'] = "password"
 gitlab_rails['smtp_domain'] = ""
 gitlab_rails['smtp_authentication'] = "login"
 gitlab_rails['smtp_enable_starttls_auto'] = true
 gitlab_rails['smtp_tls'] = false
 gitlab_rails['smtp_openssl_verify_mode'] = 'peer'

I did that and then sudo gitlab-ctl reconfigure

But it's not sending any emails. Should i have postfix or manage some sort of certs also?

Thanks in advanced.

2 Answers

I have seen reports of gmail refusing smtp connections from some IP addresses in our ranges (along with those of other cloud providers). I would recommend checking your log files for any error messages /var/log/gitlab/gitlab-rails/production.log is a good place to start.

If you are seeing messages there indicating that gmail is refusing the connection I would recommend using a service like sendgrid to send mail from your droplet. The service is free for up to 12,000 emails per month. I use them in my own projects and have never encountered a problem.

If you are seeing a different error message indicated please share it here so we can dig into it.

  • After registering a user It says:

    Redirected to
    Completed 302 Found in 633ms (ActiveRecord: 12.3ms)
    Started GET "/users/almost_there" for at 2016-05-08 15:29:07 -0400
    Processing by ConfirmationsController#almost_there as HTML
    Completed 200 OK in 458ms (Views: 79.4ms | ActiveRecord: 18.0ms)
    [ActiveJob] [ActionMailer::DeliveryJob] [659efdf3-7685-4f70-bbda-ad3227d69623] Performing ActionMailer::DeliveryJob from Sidekiq(mailers) with arguments: "DeviseMailer", "confirmation_instructions", "deliver_now", gid://gitlab/User/7, "X_GEdGHH53yQFkE6jAzo", {}
    [ActiveJob] [ActionMailer::DeliveryJob] [659efdf3-7685-4f70-bbda-ad3227d69623]
    Sent mail to (37.7ms)
    [ActiveJob] [ActionMailer::DeliveryJob] [659efdf3-7685-4f70-bbda-ad3227d69623] Performed ActionMailer::DeliveryJob from Sidekiq(mailers) in 915.88ms
  • Now im getting this emails:

    Hi Luis,
    Someone just tried to sign in to your Google Account from an app that doesn't meet modern security standards.

    Sunday, May 8, 2016 12:51 PM (Pacific Daylight Time)
    San Francisco, CA, USA*

    We strongly recommend that you use a secure app, like Gmail, to access your account. All apps made by Google meet these security standards. Using a less secure app, on the other hand, could leave your account vulnerable. Learn more.

Do i need to have SSL on my domain enabled?

Have another answer? Share your knowledge.