gpt4 book ai didi

email - Postfix 不发送邮件

转载 作者:行者123 更新时间:2023-12-05 00:49:43 26 4
gpt4 key购买 nike

我一直在尝试设置 postfix,以便它可以向我网站上的用户发送(不需要接收)电子邮件(例如帐户验证电子邮件)。

我通过 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,这应该意味着电子邮件已成功发送....但是我检查了我的收件箱/垃圾邮件/垃圾邮件/垃圾邮件,但没有收到电子邮件。我也尝试过使用不同的电子邮件。

最佳答案

要检查您的 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

那么最好看看这个网址:

https://de.postfix.org/httpmirror/COMPATIBILITY_README.html

关于email - Postfix 不发送邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37710031/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com