Gitlab,docker和sendmail端口

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

我的问题:

  1. 任何人都可以确认比使用sendmail,而且我不需要configuration一些东西?
  2. 有没有简单的方法来testing本地发送邮件,看是否有阻塞端口的问题? 我find的所有指南都从几页configuration细节开始。
  3. sendmail需要什么端口才能工作? 我是否需要暴露容器或防火墙上的其他端口?

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

supervisord reload # restart the service 

 supervisorctl reload 

另一种方法是构build自己的Docker镜像并更新production.rb环境文件。 以下是您的Dockerfile可能的样子。

 FROM sameersbn/gitlab:7.14.0 MAINTAINER "leo.o'donnell@pearson.com" # 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 

或者你可以使用我的形象

docker拉leopoldodonnell / gitlab

我昨天遇到了同样的问题,并提出了你的问题。 现在我设法让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