GitLab后缀配置邮件不发送

Lea*_*cia 13 git nginx gitlab

我在我的Ubuntu 12.04服务器上安装了GitLab.现在我可以作为管理员登录,做一些事情,但是,我的问题是电子邮件似乎不起作用.我需要确认发送到我地址的确认电子邮件.

我按照自述文件的说明安装了postfix.如何测试我的后缀或配置GitLab配置.

joj*_*ojo 6

如果您的ISP阻止端口25(这种情况经常发生,并且我也是如此),您可以使用Gmail作为中继.以下说明来自此处,逐步引导您完成整个过程:

另外/etc/postfix/main.cf:

# Relaying Postfix SMTP via GMAIL
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
Run Code Online (Sandbox Code Playgroud)

然后,您需要设置Gmail凭据.对于这个open/create /etc/postfix/sasl_passwd和write:

[smtp.gmail.com]:587    USERNAME@gmail.com:PASSWORD
Run Code Online (Sandbox Code Playgroud)

在哪里(你可能已经猜到了)USERNAME并且PASSWORD是你的凭据.然后更改文件的权限:

$ sudo chmod 400 /etc/postfix/sasl_passwd
$ sudo postmap /etc/postfix/sasl_passwd
Run Code Online (Sandbox Code Playgroud)

现在我们需要将证书添加到Postfix:

$ cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem
Run Code Online (Sandbox Code Playgroud)

只需重启postfix就可以了:

$ sudo service postfix restart
Run Code Online (Sandbox Code Playgroud)

如果你想测试:

$ echo "Hello World" | mail -s "Test Message" you@example.com
Run Code Online (Sandbox Code Playgroud)

并检查邮件日志对它的看法:

$ tail /var/log/mail.log
Run Code Online (Sandbox Code Playgroud)

注意:您每天只有500封电子邮件使用Gmail的SMTP服务器作为中继.


小智 1

你的问题可能有很多原因..

  1. 检查您的邮件日志(更多/var/log/mail.log)
  2. 如果你使用 iptables 确保你没有阻塞端口 25 (sudo ufw allowed 25)
  3. 尝试从命令行发送电子邮件并检查日志 http://www.simplehelp.net/2008/12/01/how-to-send-email-from-the-linux-command-line/
  4. 请咨询您的 ISP,可能会阻止端口 25