SMTP settings

If you would rather send application email via an SMTP server instead of via Sendmail, add the following configuration information to /etc/gitlab/gitlab.rb and run gitlab-ctl reconfigure. Check out more info at gitlab website.

~# cat /etc/gitlab/gitlab.rb | grep smtp | grep -v "#"

    gitlab_rails['smtp_enable'] = true
    gitlab_rails['smtp_address'] = "smtp.server"
    gitlab_rails['smtp_port'] = 465
    gitlab_rails['smtp_user_name'] = "smtp user"
    gitlab_rails['smtp_password'] = "smtp password"
    gitlab_rails['smtp_domain'] = "example.com"
    gitlab_rails['smtp_authentication'] = "login"
    gitlab_rails['smtp_enable_starttls_auto'] = false
    gitlab_rails['smtp_tls'] = true

If your SMTP server does not like the default ‘From: gitlab@localhost’ you

    gitlab_rails['gitlab_email_from'] = 'gitlab@example.com'
    gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'

Run reconfigure

~# gitlab-ctl reconfigure

Check logs if you need with tail or in the interface.

~# tail -f /var/log/gitlab/gitlab-rails/sidekiq.log