Gitlab,docker和sendmail端口

aqu*_*tae 9 email smtp sendmail gitlab docker

我有gitlab使用这个图像运行docker .在映像文档中,有关于如何为电子邮件配置可选SMTP服务器的说明,但没有关于未设置SMTP时会发生什么的信息.gitlab文档表明默认使用sendmail,所以我认为这就是发生的事情,并且出于我的目的(一些只有几个用户的私有存储库)我认为我真的不需要sendmail.我试图忽略SMTP配置,它运行正常,但不发送电子邮件.我不太了解电子邮件服务器或sendmail知道如何找到问题,但我的猜测是它需要的某些端口被阻止.

我的问题:

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

Shu*_*huo 0

我昨天遇到了同样的问题并投票支持了你的问题。现在我成功地使 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
Run Code Online (Sandbox Code Playgroud)