天天看点

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

继续阅读