4
4

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.

GitLab12メールサーバ機能設定

Last updated at Posted at 2019-06-19

概要

  • GitLab7からGitLab11へ移行中
  • 利用者各自でユーザを登録するためメールサーバの機能が必要となる
  • smtpはGmailを使用することによって手間を省く

手順

GitLabでメール機能設定

  • Configを以下のように変更する
$ sudo vi /etc/gitlab/gitlab.rb
external_url 'http://gitlab.geeplus.net'
:
:
### Email Settings
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'hogehoge@fuga.jp'
gitlab_rails['gitlab_email_display_name'] = 'hogehoge'
gitlab_rails['gitlab_email_reply_to'] = 'hogehoge@fuga.jp'
:
:
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "hogehoge@fuga.jp"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
:
:

GitLabをビルドしなおす

$ sudo gitlab-ctl reconfigure
Starting Chef Client, version 13.6.4
resolving cookbooks for run list: ["gitlab-ee"]
Synchronizing Cookbooks:
  - package (0.1.0)
  - gitlab-ee (0.0.1)
:
:
gitlab Reconfigured!

Gitlabを再起動する

$ sudo gitlab-ctl restart

Googleアカウントのセキュリティを下げる

image.png

  • "安全性の低いアプリの許可: 有効"に変更する

image.png

メールが届くことを確認する

  • メールを確認する

image.png

image.png

遭遇したエラー

Googleにはじかれる

  • 前述の「Googleアカウントのセキュリティを下げる」をやっていない場合に発生

image.png

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?