配送暂时停止:未找到主机或域名

配送暂时停止:未找到主机或域名

我有两个独立的域名ad.vz和ad2.vz,它们之间有网关。有3个postfix服务器:

  • mailad.ad.vz-第一个域中的 postfix 服务器
  • mailsh-带有postfix和两个网络适配器的网关
  • mailinet.ad2.vz-第二个域中的 postfix 服务器

Mailsh 一次只能连接到一个网络区域。有工作中继,每 30 秒打开/关闭 eth。我在 mailad 中开始压力测试,每 30 秒发送 20 封信件,500KB。有时队列开始累积。我可以在 maillog 中看到以下消息:

Sep  4 08:51:01 mailsh postfix/error[9602]: CFA5E131A7: to=<[email protected]>, relay=none, delay=33, delays=32/0/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=mailinet.ad.vz type=MX: Host not found, try again)"

每次适配器出现时,我都会发送命令postqueue -f

为什么队列会累积?

mailad postconf:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = vzavod.ru
myhostname = mailad.vzavod.ru
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
transport settings:
vzavod.ru   local
*       smtp:mailsh.ad.vz

mailsh postconf:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = vzavod.ru
myhostname = mailsh.vzavod.ru
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550

运输设置:

*       smtp:mailinet.ad.vz
vzavod.ru   smtp:mailad.ad.vz

答案1

看起来您的情况与本文中的情况类似:拨号机中的 postfix

摘自那篇文章,这里有一些思考。

  • 禁用自发 SMTP 邮件传递(如果仅使用按需拨号 IP)。

    使用以下参数,除非您手动运行,否则 postfix 将不会尝试发送电子邮件postqueue -f。将此参数放在 中main.cf。更多信息这里

      defer_transports = smtp # (Only for on-demand dialup IP hosts)
    
  • 禁用 SMTP 客户端 DNS 查找(仅限拨号 LAN)。

    禁用 Postfix SMTP 和 LMTP 客户端中的 DNS 查找。禁用后,将使用 getaddrinfo() 系统库例程查找主机,该例程通常还会查找/etc/hosts。因此,将条目放在mailad.ad.vz/etc/hosts。例如

      # echo "192.168.1.99  mailad.ad.vz" >> /etc/hosts
    

    并添加此参数main.cf

      disable_dns_lookups = yes #(Only for on-demand dialup IP hosts)
    

相关内容