尝试从我的 centOS 7 服务器发送邮件,但失败了。
以下是邮件的摘录,其中包含我认为的原因,但我不确定如何解决。
我相信我的主机文件中有正确的设置,但可能是错误的。
注意:我已将我的电子邮件地址替换为[电子邮件受保护]。
邮件日志也有 stat=sent。
The original message was received at Tue, 29 Nov 2016 10:46:18 GMT
from localhost [127.0.0.1]
----- The following addresses had permanent fatal errors -----
<[email protected]>
(reason: 550 Host unknown)
----- Transcript of session follows -----
550 5.1.2 <[email protected]>... Host unknown (Name server: myaddress.com: host not found)
编辑
#/usr/sbin/sendmail -d8.20 -bv [email protected]
Warning: OperatorChars is being redefined.
It should only be set before ruleset definitions.
Warning: OperatorChars is being redefined.
It should only be set before ruleset definitions.
Warning: OperatorChars is being redefined.
It should only be set before ruleset definitions.
dns_getcanonname(myaddress.com, trymx=1)
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
dns_getcanonname: trying myaddress.com. (AAAA)
YES
[email protected]... deliverable: mailer local, user email
答案1
执行以下命令可查看 sendmail.org/sendmail.com 发出的 DNS 查询:
/usr/sbin/sendmail -d8.20 -bv [email protected]
如果非特权用户执行命令没有结果,请以 root 身份执行该命令。
答案2
我现在可以使用了。为了他人的利益,这就是我所做的:
卸载了sendmail和sendmail-cf,这样我就可以开始新的
yum删除sendmail sendmail-cf
再次重新安装它们
yum install sendmail sendmail-cf
编辑 /etc/mail/sendmail.mc
将 LOCAL_DOMAIN 选项设置为您的计算机主机名 LOCAL_DOMAIN(`example.com')dnl
接下来运行
make -C /etc/mail
edit /etc/hosts
127.0.0.1 主机名 主机名.域名
172.16.213.146(我的内部 ip) 主机名 主机名.域名 域名
编辑 /etc/sysconfig/network HOSTNAME 应等于您的计算机主机名
最后运行
service sendmail restart
这就是我在虚拟机服务器上的工作原理,这里可能有一些不必要的步骤,我无法解释它们,但它使它工作了。感谢大家的意见。