Postfix-未找到主机或域名-查找错误的域名

Postfix-未找到主机或域名-查找错误的域名

我想知道在哪里可以配置以下内容。

我想让 postfix 查找主机:myexample.com,但它却在查找 Host-Wordpress-01。这是我的 digitalocean droplets 名称。

我如何/在哪里可以更改此设置?我对 postfix 中的所有文件进行了 grep,没有找到任何包含“Host-Wordpress-01”的内容。所以它应该在其他地方。

下面是 syserror.log 的摘录

Feb 13 15:25:17 Host-Wordpress-01 postfix/pickup[29410]: 3A8D6609C0: uid=0 from=<root@Host-Wordpress-01>
Feb 13 15:25:17 Host-Wordpress-01 postfix/cleanup[29422]: 3A8D6609C0: message-id=<[email protected]>
Feb 13 15:25:17 Host-Wordpress-01 postfix/qmgr[29411]: 3A8D6609C0: from=<root@Host-Wordpress-01>, size=356, nrcpt=1 (queue active)
Feb 13 15:25:17 Host-Wordpress-01 postfix/smtp[29424]: 3A8D6609C0: to=<root@Host-Wordpress-01>, relay=none, delay=0.03, delays=0.02/0.01/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=Host-Wordpress-01 type=A: Host not found)
Feb 13 15:25:17 Host-Wordpress-01 postfix/cleanup[29422]: 4247F61E26: message-id=<[email protected]>
Feb 13 15:25:17 Host-Wordpress-01 postfix/qmgr[29411]: 4247F61E26: from=<>, size=2279, nrcpt=1 (queue active)
Feb 13 15:25:17 Host-Wordpress-01 postfix/bounce[29425]: 3A8D6609C0: sender non-delivery notification: 4247F61E26
Feb 13 15:25:17 Host-Wordpress-01 postfix/qmgr[29411]: 3A8D6609C0: removed
Feb 13 15:25:17 Host-Wordpress-01 postfix/smtp[29424]: 4247F61E26: to=<root@Host-Wordpress-01>, relay=none, delay=0.01, delays=0/0/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=Host-Wordpress-01 type=A: Host not found)
Feb 13 15:25:17 Host-Wordpress-01 postfix/qmgr[29411]: 4247F61E26: removed

我有

  • 为 example.com 设置 3 条 MX 记录,引用 mail.myexample.com(优先级 10、20、30)
  • 为 mail.myexample.com 设置一条指向正确 IP 的 A 记录
  • 使用 dig mx myexample.com 和 dig a mail.myexample.com 检查它们
  • 更改了 postfix 的 inet_protocols 设置,因此它使用 ip4 而不是 ip6

答案1

这就是 postfix 中多个配置的效果:myhostname、myorigin 和 append_at_myorigin。

当您使用mail命令/sendmail发送电子邮件时,发件人没有域部分。由于参数append_at_myorigin=yes,postfix在发件人名称中附加了$myorigin参数。默认情况下,的值myorigin等于$myhostname。并且的值myhostname是您的服务器的主机名。

参考:http://www.postfix.org/postconf.5.html

相关内容