2014-10-06 136 views
9

我已经通过docker使用this图像运行gitlab。在映像文档中有关于如何为电子邮件配置可选SMTP服务器的说明,但是有关如果未设置SMTP会发生什么的信息。 gitlab文档指出,默认情况下使用sendmail,所以我认为这是发生了什么,并为我的目的(几个私人存储库只有几个用户),我不认为我真的需要比sendmail更多。我试图忽略SMTP配置,它都运行正常,但电子邮件不发送。我不太了解电子邮件服务器或sendmail知道如何发现问题,但我的猜测是它需要的某个端口被阻止。Gitlab,docker和sendmail端口

我的问题:

  1. 谁能比sendmail的确认被使用,而且我也不需要配置什么?
  2. 是否有一些简单的方法来在本地测试sendmail以查看端口是否存在阻塞问题?我找到的所有指南都从几页配置细节开始。
  3. sendmail需要开放哪些端口才能工作?我是否需要公开容器或防火墙上的其他端口?

回答

0

我昨天遇到同样的问题,并upvoted你的问题。现在我设法让smtp在没有send_mail的情况下工作。

sudo docker exec -it gitlab /bin/bash # go into the container 
vi /home/git/gitlab/gitlab/config/environments/production.rb # The path may not exactly match, but you can guess 
now search email and the method is :send_mail, change it to :smtp 
supervisord reload # restart the service 
3

硕的回答为我工作,除了我改变:

supervisord reload # restart the service 

supervisorctl reload 

另一种方法是建立自己的码头工人形象和更新production.rb环境文件。以下是Dockerfile的外观。

FROM sameersbn/gitlab:7.14.0 

MAINTAINER "leo.o'[email protected]" 

# sed the production.rb environment file to use a configured email method converting 
# 
# config.action_mailer.delivery_method = :sendmail 
# 
# to 
# config.action_mailer.delivery_method = (ENV['SMTP_DELIVERY_METHOD'] || :sendmail).to_sym 
RUN sed -E -e "s/(action_mailer.delivery_method[^\:]+)([^ \t\#]+)(.*)/\1\(ENV\[\'SMTP_DELIVERY_METHOD\'\] \|\| \2\).to_sym\3/" -i config/environments/production.rb 

或者你可以使用我的形象

搬运工拉leopoldodonnell/gitlab

+0

并没有为我工作。我得到bash:supervisorctl:command not found。我错过了什么吗? – 2017-08-14 11:18:30