天天看點

Gitlab郵件提醒設定

Gitlab郵件提醒友善跟蹤項目進度,在這裡介紹兩種方式,一種是用系統的sendmail發送郵件,另一種是GMAIL的stmp來發送郵件

第一種 用系統的sendmail發送郵件

cd /home/gitlab/gitlab/

vi config/environments/production.rb

将這行 # config.action_mailer.delivery_method = :sendmail

改為    config.action_mailer.delivery_method = :sendmail

儲存config/environments/production.rb

編輯config/gitlab.yml

vi config/gitlab.yml

對應修改一下配置

web:

  host: gitlab123.com

  port: 80

  https: false

email:

   from: [email protected]

   protocol: http

   host: gitlab123.com

git_host:

編輯/etc/hosts

加入你的ip對應gitlab123.com

10.0.0.71    gitlab123.com

第二種 GMAIL的stmp來發送郵件

在# config.action_mailer.delivery_method = :sendmail下加入

config.action_mailer.delivery_method = :smtp

config.action_mailer.perform_deliveries = true

config.action_mailer.raise_delivery_errors = true

config.action_mailer.smtp_settings = {

  :address              => "smtp.gmail.com",

  :port                 => 587,

  :domain               => 'gmail.com',

  :user_name            => '[email protected]',

  :password             => 'password',

  :authentication       =>  :plain,

  :enable_starttls_auto => true

}

#配置好你的郵箱和密碼

   from: [email protected]

<a href="http://blog.51cto.com/attachment/201209/104602230.jpg" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201209/104615921.jpg" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201209/104629987.jpg" target="_blank"></a>

本文轉自 ppabc  51CTO部落格,原文連結:http://blog.51cto.com/ppabc/1008999

繼續閱讀