CentOS8使用sendmail发邮件报错
Diagnostic-Code: X-Postfix; Host or domain name not found. Name
service error for name=test.com type=A: Host not found
确认步骤
1.hosts文件正确配置
2.ping test.com正常
3.telnet test.com 25 正常
4.修改main.cf的inet_protocols = ipv4
这时候还是提示域名找不到,最后在官网文档看到个东西
smtp_host_lookup = native
把这个配置加到/etc/postfix/main.cf末尾就可以了