SMTP settings missing / not applied
For reference: https://forum.mattermost.org/t/smtp-settings-missing-in-gitlab-ce/3810
We are using Mattermost with the Gitlab-ce installation. Emails in Gitlab work using an Exchange server with the following settings:
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.[...].ch"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "git"
gitlab_rails['smtp_password'] = "[...]"
gitlab_rails['smtp_domain'] = "mail.[...].ch"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
Mattermost is configured as close as possible but doesn't work. config:
mattermost['email_enable_sign_up_with_email'] = false
mattermost['email_enable_sign_in_with_email'] = false
mattermost['email_enable_sign_in_with_username'] = false
mattermost['email_send_email_notifications'] = true
mattermost['email_require_email_verification'] = false
mattermost['email_smtp_username'] = "git"
mattermost['email_smtp_password'] = "[...]"
mattermost['email_smtp_server'] = "mail.[...].ch"
mattermost['email_smtp_port'] = 587
mattermost['email_connection_security'] = "STARTTLS" # tried different things here
mattermost['email_feedback_name'] = "[...]"
mattermost['email_feedback_email'] = "[...]"
Which leads to the following mattermost config.json:
"EnableSignUpWithEmail": false,
"EnableSignInWithEmail": false,
"EnableSignInWithUsername": false,
"SendEmailNotifications": true,
"RequireEmailVerification": false,
"FeedbackName": "[...]",
"FeedbackEmail": "git@[...].ch",
"FeedbackOrganization": "",
"SMTPUsername": "git",
"SMTPPassword": "[...]",
"SMTPServer": "mail.[...].ch",
"SMTPPort": "587",
"ConnectionSecurity": "",
"InviteSalt": "[...]",
"SendPushNotifications": false,
"PushNotificationServer": "",
"PushNotificationContents": "generic",
"EnableEmailBatching": false,
"EmailBatchingBufferSize": 256,
"EmailBatchingInterval": 30,
"SkipServerCertificateVerification": false,
"EnableSMTPAuth": false,
"EmailNotificationContentType": "full"
First: We noticed is that ConnectionSecurity is not set (although set in gitlab.rb -> mattermost['email_connection_security = "STARTTLS"). Also EnableSMTP false seems wrong, user and password are provided... In the admin_console these settings are the same as in config.json.
Second: In the config.json are fields available that might be needed for our setup, but are missing in the gitlab.rb:
- EnableSMTPAuth (= gitlab_rails['smtp_authentication'] ?!)
- SkipServerCertificateVerification (= gitlab_rails['smtp_openssl_verify_mode'] ?!)
- ConnectionSecurity ( = STARTTLS, like gitlab_rails['smtp_enable_starttls_auto'] ?!)
Third: The mattermost log shows the following error after setting all the correct setting in admin_console:
2017-09-05_13:29:31.55018 [2017/09/05 15:29:31 CEST] [EROR] /api/v4/email/test:SendMail code=500 rid=u31w4bhee7y8df3pm1yffqy9cw uid=4mfjbwy7478xfqd5bw86ngk7ia ip=*** Failed to authenticate on SMTP server [details: 504 5.7.4 Unrecognized authentication type]
Summary
SMTP settings ing gitlab.rb are missing or not applied correctly.
Steps to reproduce
GitLab Community Edition 9.5.4
- Try to use similar settings for mattermost as in gitlab_rails in gitlab.rb (connecting to Exchange server using user/pw auth)
- EnableSMTPAuth (= gitlab_rails['smtp_authentication'])
- SkipServerCertificateVerification (= gitlab_rails['smtp_openssl_verify_mode'])
- ConnectionSecurity ( = STARTTLS, like gitlab_rails['smtp_enable_starttls_auto'])
- apply config (gitlab-ctl reconfigure)
Expected behavior
Mattermost e-mail notifications are working, config.json and admin_console show the settings as they are defined in the gitlab.rb. The "Test Connection" button in admin_console shows success.
Observed behavior
E-mail notifications don't work, the config.json/admin_console settings don't relect the gitlab.rb settings.
Even after changing the admin_console settings "Test Connection" still doesn't work (see log details above).