Gitlab郵件提醒方便跟蹤項(xiàng)目進(jìn)度,在這里介紹兩種方式,一種是用系統(tǒng)的sendmail發(fā)送郵件,另一種是GMAIL的stmp來發(fā)送郵件
第一種 用系統(tǒng)的sendmail發(fā)送郵件
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
對(duì)應(yīng)修改一下配置
web:
host: gitlab123.com
port: 80
https: false
email:
from: notify@gitlab123.com
protocol: http
host: gitlab123.com
git_host:
host: gitlab123.com
編輯/etc/hosts
加入你的ip對(duì)應(yīng)gitlab123.com
10.0.0.71 gitlab123.com
第二種 GMAIL的stmp來發(fā)送郵件
cd /home/gitlab/gitlab/
vi config/environments/production.rb
在# 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 => 'account@gmail.com',
:password => 'password',
:authentication => :plain,
:enable_starttls_auto => true
}
#配置好你的郵箱和密碼
編輯config/gitlab.yml
vi config/gitlab.yml
對(duì)應(yīng)修改一下配置
email:
from: account@gmail.com
protocol: http
PS:gitlab 配置騰訊企業(yè)郵箱
默認(rèn)情況下,gitlab用qq郵箱注冊(cè)是發(fā)送不出確認(rèn)郵件的。
下面說說gitlab配置騰訊企業(yè)郵箱
# vim /etc/gitlab/gitlab.rb
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "support@ttlsa.com"
gitlab_rails['smtp_password'] = "www.ttlsa.com"
gitlab_rails['smtp_domain'] = "ttlsa.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = "support@ttlsa.com"
重新加載配置
# gitlab-ctl reconfigure