git GitLab 电子邮件通知不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22460348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:51:35  来源:igfitidea点击:

GitLab email notification not working

gitemailnotificationssmtpgitlab

提问by Adil Ouchraa

I just set up gitlab on my dedicated server, As Admin I created a new user, He should normally receive an email with his password, But He doesn't.

我刚刚在我的专用服务器上设置了 gitlab,作为管理员,我创建了一个新用户,他通常应该收到一封带有密码的电子邮件,但他没有。

What I want to know is how to configure email notifications (with SMTP).

我想知道的是如何配置电子邮件通知(使用 SMTP)。

PS: I'm not familiar with Ruby environment at all.

PS:我根本不熟悉Ruby环境。

Thank you.

谢谢你。

Update : it works now, I just forgot to install postfix when setting up gitlab

更新:它现在可以工作了,我只是在设置 gitlab 时忘记安装 postfix

Update 2 : Finally I've choose to use an SMTP account to send email notifications:

更新 2:最后我选择使用 SMTP 帐户发送电子邮件通知:

Personally I've an Amazone account (You Can use Gmail) :

我个人有一个 Amazone 帐户(您可以使用 Gmail):

1) In /home/git/gitlab/config/envirenoments/production.rb comment this line :

1) 在 /home/git/gitlab/config/envirenoments/production.rb 注释这一行:

#config.action_mailer.delivery_method = :sendmail

2) Add this (with correct credentials) just before end tag :

2)在结束标签之前添加这个(使用正确的凭据):

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
     :address => 'gmail.com', // Or an other SMTP provider 
     :port => 467, // Port depends on your provider
     :domain => 'gitlab.yourserver.com', // Your Gitlab main url
     :authentication => :plain,
     :user_name => 'your gmail id',
     :password => 'yourPassword',
     :enable_starttls_auto => true
 }

Thank you, I hope it gonna help you.

谢谢,希望能帮到你。

回答by Adil Ouchraa

Finally I've chosen to use an SMTP account to send email notifications:

最后我选择使用 SMTP 帐户发送电子邮件通知:

Personally I've an Amazone account (You Can use Gmail) :

我个人有一个 Amazone 帐户(您可以使用 Gmail):

1) In /home/git/gitlab/config/envirenoments/production.rb comment this line :

1) 在 /home/git/gitlab/config/envirenoments/production.rb 注释这一行:

#config.action_mailer.delivery_method = :sendmail

2) Add this (with correct credentials) just before end tag :

2)在结束标签之前添加这个(使用正确的凭据):

config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
     :address => 'gmail.com', # Or an other SMTP provider 
     :port => 467, # Port depends on your provider
     :domain => 'gitlab.yourserver.com', # Your Gitlab main url
     :authentication => :plain,
     :user_name => 'your gmail id',
     :password => 'yourPassword',
     :enable_starttls_auto => true  }

Thank you, I hope it gonna help you.

谢谢,希望能帮到你。

回答by Sytse Sijbrandij

Please follow the installation guide, it includes instructions for setting up email.

请按照安装指南进行操作,其中包括设置电子邮件的说明。