5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitlabでGmailアカウントによるSMTPメール送信の設定方法(2019.9時点)

Posted at

概要

公式サイトで丁寧にGilabのSMTP設定手順が記載されていたが、残念ながらその設定値では送信できませんでしたので、改めて残したいと思います

以下の設定値でダメなら、以下を試してください

設定値

smtp_tls=truesmtp_authentication=plainが公式の設定値と異なります

/etc/gitlab/gitlab.rb

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "<gmail user name>"
gitlab_rails['smtp_password'] = "<gmail password>"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true

###! **Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'**
###! Docs: http://api.rubyonrails.org/classes/ActionMailer/Base.html
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'

設定後 gitlab-ctl reconfigure を実行します

確認方法

gitlab-rails consoleでgitlabコンソールを開き、以下のコマンドでテストメールを送信します
※上記の設定値を反映したならば、必ず一度gitlabコンソールを終了し、再度始めること!!(そのままだと設定値が反映されない)
https://docs.gitlab.com/omnibus/settings/smtp.html#testing-the-smtp-configuration

> Notify.test_email('destination_email@address.com', 'Message Subject', 'Message Body').deliver_now
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?