3

I configured GitLab on Google Cloud Platform to send mail. This is the configuration

root@mojlab:/home/d# cat /etc/gitlab/gitlab.rb
...
nginx['listen_addresses'] = ["0.0.0.0", "[::]"]

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.sendgrid.net"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "du"
gitlab_rails['smtp_password'] = "fakePas$"
gitlab_rails['smtp_domain'] = "smtp.sendgrid.net"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
root@mojlab:/home/d# 

Mail messages I get are from a GitLab address name and the GitLab sender name.

enter image description here

I am trying to change the sender name. I change a file /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml in the line 42 from

    email_display_name:

to

    email_display_name: NewName

but after a command gitlab-ctl reconfigure the change disappears. The value turns back to blank.

How to change the sender name?

trzczy
  • 1,325
  • 2
  • 18
  • 43

1 Answers1

3

If you do have a gitlab.rb, it would be best to try and set that parameter in gitlab.rb, not in gitlab.yml.
See this diff for example.

gitlab_rails['gitlab_email_display_name'] = 'Example'

Then try the gitlab-ctl reconfigure again, which will take into account gitlab.rb value.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Where should I want to implement the command content(gitlab rails) in GitLab? gitlab.rb should be placed in each repository ? right? – Cyril I Apr 25 '22 at 14:45
  • @CyrilI I have never seen `content(gitlab_tails)` implemented. And [`gitlab.rb`](https://docs.gitlab.com/omnibus/settings/configuration.html) is a config GitLab file, not a repository file/ – VonC Apr 25 '22 at 14:57