Postfix不发送邮件

时间:2016-06-08 18:19:53

标签: email postfix-mta

我一直在努力获得后缀设置,以便它可以发送(不需要它接收)电子邮件给我网站上的用户(例如帐户验证电子邮件)。

我通过mailutils安装postfix(安装postfix以及其他东西)。

sudo apt-get install mailutils

然后我编辑后缀的配置文件...

sudo nano /etc/postfix/main.cf

我改变了行......

inet_interfaces = all

为...

inet_interfaces = localhost

然后我使用此命令重新启动postfix ...

sudo service postfix restart

最后,我通过运行以下命令测试安装...

php -a
echo mail("myemail@gmail.com", "Hello", "My email worked!");

echo将1打印到终端上,这应该意味着电子邮件已成功发送....但我已经检查了我的收件箱/垃圾/垃圾邮件/垃圾邮件,但未收到电子邮件。我也尝试过不同的电子邮件。

2 个答案:

答案 0 :(得分:0)

感觉像是什么时候......

我发现问题是因为我在postfix上启用了ipv6。我禁用了它,解决了这个问题。

答案 1 :(得分:0)

要检查Postfix服务器的状态,请查看日志文件中的问题

 tail -f /var/log/mail.log

您可能会看到类似的内容:

Jun 25 23:53:43 ubuntu postfix/smtp[6576]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c06::1b]:25: Network is unreachable

或者也许是这个问题:

Jun 25 23:12:41 ubuntu postfix[5152]: Postfix is running with backwards- 
compatible default settings
Jun 25 23:12:41 ubuntu postfix[5152]: See 
http://www.postfix.org/COMPATIBILITY_README.html for details
Jun 25 23:12:41 ubuntu postfix[5152]: To disable backwards compatibility use 
"postconf compatibility_level=2" and "postfix reload"
Jun 25 23:12:42 ubuntu postfix/master[5197]: daemon started -- version 
3.1.0, configuration /etc/postfix

那么最好检查一下该URL:

https://de.postfix.org/httpmirror/COMPATIBILITY_README.html
相关问题