Linux
找不到後綴 MX 主機
我正在嘗試使用 Postfix 發送郵件,但我收到所有電子郵件的以下錯誤:
May 13 12:44:46 myhost postfix/qmgr[12169]: A6D9644526: from=<x@y.com>, size=317, nrcpt=1 (queue active) May 13 12:44:46 myhost postfix/smtp[12178]: A6D9644526: to=<z@gmail.com>, relay=none, delay=0.03, delays=0.02/0/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)
閱讀連結的問題,我已經檢查過
/etc/resolv.conf
,/var/spool/postfix/etc/resolv.conf
它們都是相同的。我的resolv.conf
樣子:nameserver 2001:4b98:dc0:49::225 nameserver 217.70.184.225 nameserver 217.70.184.226 options timeout:1 attempts:3 rotate
dig mx gmail.com
作品:; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> mx gmail.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64383 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 4, ADDITIONAL: 15
以下是 的內容
/etc/postfix/main.cf
:smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no readme_directory = no smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = myhost alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = ipv4
知道為什麼找不到郵件主機嗎?
似乎錯誤是由於 /etc/resolv.conf 中的 ipv6 地址引起的。我刪除了它,它現在可以工作了。