Gitlab smtp configuration

Hi,
Ive configured smtp by following SMTP settings | GitLab.

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "email-smtp.myzone.amazonaws.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "MyUserName"
gitlab_rails['smtp_password'] = "MyPassword"
gitlab_rails['smtp_domain'] = "noreply@mydomain.in"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true

but when I try

 --------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       15.3.2 (e5a7085d434) FOSS
 GitLab Shell: 14.10.0
 PostgreSQL:   14.5
------------------------------------------------------------[ booted in 61.79s ]
Loading production environment (Rails 6.1.6.1)
irb(main):001:0> Notify.test_email('myemail@mydomain.com', 'foo', 'bar').deliver_now
Delivered mail 63e1f7958062a_da913466421465@gitlab.mail (294.4ms)
Traceback (most recent call last):
        1: from (irb):1
Net::SMTPFatalError (554 Message rejected: Email address is not verified. The following identities failed the check in region myzone: GitLab <gitlab@gitlab.mydomain.com>, gitlab@gitlab.mydomain.com)

My gitlab domain is β€˜.com’ and my smtp domain is β€˜.in’

this same config on other apps works fine.

Hi,

Try setting:

gitlab_rails['gitlab_email_from'] = 'gitlab@mydomain.in'

if not using this field, it defaults to as you see gitlab@gitlab.mydomain.in which is the name of your Gitlab server. If your mail server is not configured to process emails for gitlab.mydomain.in it fails like you saw.

1 Like

Thankyou! It worked!

1 Like