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 thing 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 (accoring to config.json, not gitlab.rb).
In the config.json are fields available that might be needed for our setup, but not int the gitlab.rb:
- EnableSMTPAuth (= gitlab_rails[‘smtp_authentication’] ?!)
- SkipServerCertificateVerification (= gitlab_rails[‘smtp_openssl_verify_mode’] ?!)
- ConnectionSecurity ( = STARTTLS, like gitlab_rails[‘smtp_enable_starttls_auto’] ?!)
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]
What are we doing wrong?!