Linux

後綴問題發送電子郵件“RCPT 拒絕未列出的本地主機”

  • July 30, 2015

我很難讓後綴發送電子郵件。

這是 mail.log 條目:

Jun 30 18:27:46 vm21 postfix/smtpd[15682]: warning: ::1: address not listed for hostname localhost
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: connect from unknown[::1]
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: NOQUEUE: reject: RCPT from unknown[::1]: 554 5.7.1 <momchilrogelov@gmail.com>: Relay access denied; from=<ubuntu@debeldecibel.com> to=<momc$
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: lost connection after RCPT from unknown[::1]
Jun 30 18:27:46 vm21 postfix/smtpd[15682]: disconnect from unknown[::1]

/etc/hosts 文件有

::1     localhost ip6-localhost ip6-loopback

這是我的 postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 4h
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
mydestination = debeldecibel.com, localhost
myhostname = smtp.debeldecibel.com
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

“未列出本地主機地址”消息具有誤導性。採用:

mynetworks = 127.0.0.0/8 [::1]/128

檢查 /etc/hosts 文件。

是否插入了 localhost 的 ipv6 地址?

該行應如下所示:

::1     localhost ip6-localhost ip6-loopback

如果沒有添加它並重新啟動後綴。嘗試再次發送電子郵件。

引用自:https://serverfault.com/questions/156555