1. First switch to the gitlab installation directory and find the smtp configuration file:
[Root @ 21 yunwei gitlab] # vim/etc/gitlab. rb
Note: basically all gitlab configuration files are modified, such as the web entry address, port, and smtp.
################################
# GitLab email server settings #
################################
# See https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/smtp.md#smtp-settings
# Use smtp instead of sendmail/postfix.
Gitlab_rails ['smtp _ enable'] = true
Gitlab_rails ['smtp _ address'] = "mail.21yunwei.com"
Gitlab_rails ['smtp _ port'] = 25
Gitlab_rails ['smtp _ user_name '] = "gitlab"
Gitlab_rails ['smtp _ password'] = "xxxxxx"
Gitlab_rails ['smtp _ domain '] = "21yunwei.com"
Gitlab_rails ['smtp _ authentication '] = "login"
Gitlab_rails ['smtp _ enable_starttls_auto'] = true
Gitlab_rails ['smtp _ tls '] = false
Gitlab_rails ['smtp _ openssl_verify_mode '] = 'none' # Can be: 'none', 'peer', 'Client _ once ', 'fail _ if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html
Gitlab_rails ['smtp _ ca_path '] = "/etc/ssl/certs"
Gitlab_rails ['smtp _ ca_file '] = "/etc/ssl/certs/ca-certificates.crt"
After modification, you can use gitlab-ctl reconfigure after the configuration takes effect.
Restart gitlab: gitlab-ctl restart
Note: Some friends forget to configure the environment variables, and the command does not take effect. Modify/etc/profile to add the bin path of gitlab-ctl and the source/etc/profile takes effect.
Now add or modify the user, you can see the gitlab@21yunwei.com sent the mail