Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
3
Help us understand the problem. What is going on with this article?

More than 1 year has passed since last update.

@ezaqiita

GitLab12メールサーバ機能設定

概要

  • 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

3
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
3
Help us understand the problem. What is going on with this article?