Postfix – 找不到主机或域

我只是在我的ubuntu,本地networking上安装了Postfix。

在这个networking上,我有一个Exchange服务器(使用域mail.example.com)。 发送电子邮件到本地地址时遇到问题:[email protected]

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) 

我在我的postfix 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上发送邮件,并且我已经testing了一些主要的web邮件(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没有AAAAlogging(与Alogging相同,但是对于IPv6),因此不起作用。

如果您希望Postfix 永远不使用IPv6,您可以在configuration文件中更改它,如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] 

/etc/postfix/main.cf中的以下更改为我解决了这个问题。

 inet_protocols = ipv6 

改变上面的

 inet_protocols = all