Postfix - 未找到主机或域

Modified on: Fri, 05 Jul 2019 17:20:02 +0800

我刚刚在本地网络上的ubuntu上安装了Postfix。

在此网络上,我有一台Exchange Server(使用域mail.example.com)。
我在向本地地址发送电子邮件时遇到问题:adress@example.com:

relay=none, delay=0.01, delays=0.01/0/0/0, dsn=4.3.5, status=deferred 
(Host or domain name not found. Name service error for name=example.com
type=AAAA: Host found but no data record of requested type)

我在后缀main.cf中使用relay_domain解决了这个问题:

relay_domains = example.com
transport_maps = hash:/etc/postfix/transport

在我的/ etc / postfix / transport中:

example.com smtp:[mail.example.com]

现在我可以在@ example.com上发送邮件了,我测试了一些主要的网络邮件(Gmail,Yahoo,Hotmail ......)。它有效。

但为什么我的地址“@ example.com”出现了这个错误?我怎么能确定我从未在其他域上发现此错误?

我的postconf -n给:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = SRVWEB, localhost.localdomain, localhost
myhostname = SRVWEB
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relay_domains = mutuelle-var.fr
relayhost =
smtp_generic_maps = hash:/etc/postfix/generic
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/etc/postfix/transport

最佳答案

您的服务器在发送邮件时尝试使用IPv6。由于mail.example.com没有AAAA记录(与A记录相同,但对于IPv6),因此无效。

如果你希望Postfix到从不使用IPv6,你可以在配置文件中更改它,如postconf(5)手册页中所述:

When IPv6 support is enabled via the inet_protocols parameter,  Post-
fix will do DNS type AAAA record lookups.

When  both IPv4 and IPv6 support are enabled, the Postfix SMTP client
will attempt to connect via IPv6 before attempting to use IPv4.

Examples:

inet_protocols = ipv4
inet_protocols = all (DEFAULT)
inet_protocols = ipv6
inet_protocols = ipv4, ipv6

如果您只想更改此域名,请将传输地图更改为

example.com smtp-ipv4:[mail.domain.com]

相关问答

添加新评论