Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab won't send email - omnibus Gitlab CentOS 6.5

just setup a new Gitlab install using the omnibus installer on a newly provisioned CentOS 6.5 VM. I'm a bit of a Linux noob, but I've been trying to setup the Gitlab installation and am able to access the install via the host.

What has not been working is the sending of email to newly created users. I attempted setting up SMTP in /etc/gitlab/gitlab.rb using the instructions via https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#sending-application-email-via-smtp.

I set the permissions on the gitlab.rb file to 600. It is worth noting that our SMTP server does not require authentication from within the internal network, and the Omnibus documentation does not provide an example for that type of setup. For this, reason, I have omitted some of the lines that would usually be passed into the gitlab.rb file for SMTP (which may not be the right thing to do). The entire contents of my gitlab.rb file have been edited to read:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mycompany.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_domain'] = "mycompany.com"
gitlab_rails['smtp_authentication'] = false
gitlab_rails['smtp_enable_starttls_auto'] = false

And my output from gitlab-ctl show-config

  "gitlab-rails": {
  "smtp_enable": true,
  "smtp_address": "smtp.mycompany.com",
  "smtp_port": 25,
  "smtp_user_name": "[email protected]",
  "smtp_domain": "mycompany.com",
  "smtp_authentication": false,
  "smtp_enable_starttls_auto": false,

When I create a new user, the user never receives the email. Does anyone have any recommendations about where to start in troubleshooting this? There are some things on Stack but none of them match my installation (CentOS and omnibus install of Gitlab).

Additionally, if I do a command-line test of the SMTP relay that I'm referencing, I get the email immediately, so I know that's not the problem.

Thanks!

like image 545
Pdnell Avatar asked Jun 12 '14 16:06

Pdnell


2 Answers

On the latest omnibus version (7.6.1) I've succeeded to get this working with the following settings

gitlab_rails['gitlab_email_from'] = '[email protected]' #Important for our SMTP server

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.mycompany.com"
gitlab_rails['smtp_port'] = 25
#gitlab_rails['smtp_user_name'] = "" Commented out!
#gitlab_rails['smtp_password'] = "" Commented out!
gitlab_rails['smtp_domain'] = "mycompany.com"
gitlab_rails['smtp_authentication'] = false
gitlab_rails['smtp_enable_starttls_auto'] = false
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = false
like image 61
Mark Kemel Avatar answered Oct 20 '22 00:10

Mark Kemel


Unfortunately it doesn't work. I tried all sort of combinations and Googled for ages until I found the answer at https://gitlab.com/gitlab-org/omnibus-gitlab/issues/155 where they state that it is broken and will be fixed in version 7.

Omnibus comes with Postfix already, so if you delete those lines in gitlab.r then run gitlab-ctl reconfigure and gitlab-ctl status to ensure processes are running subsequent emails for new users should send out fine. If they still aren't sent, look into basics like IP and DNS settings and then move onto troubleshooting Postfix.

like image 28
Michael Szabo Avatar answered Oct 19 '22 23:10

Michael Szabo