Copy or rename the sample smtp settings file into smtp_settings.rb
sudo -u git -H cp config/initializers/smtp_settings.rb.sample config/initializers/smtp_settings.rb
Note: in 6.3.1 there is no need to modify config/environments/production.rb line: config.action_mailer.delivery_method. Leave the original value :sendmail
Edit smtp_settings.rb as follow
sudo -u git -H vim config/initializers/smtp_settings.rb
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "smtp.googlemail.com",
port: 587,
user_name: "[email protected]",
password: "password",
domain: "domain.com",
authentication: :plain,
enable_starttls_auto: true,
}
end
Restart gitlab service
service gitlab restart