postfix 发送电子邮件时出现“RCPT 拒绝未列出的本地主机”问题

postfix 发送电子邮件时出现“RCPT 拒绝未列出的本地主机”问题

我很难让 postfix 发送电子邮件。

这是 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 <[email protected]>: Relay access denied; from=<[email protected]> 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

答案1

“localhost 中未列出地址”消息具有误导性。请使用:

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

答案2

检查 /etc/hosts 文件。localhost
的 ipv6 地址是否已插入?
该行应如下所示:

::1     localhost ip6-localhost ip6-loopback

如果没有,请添加并重新启动 postfix。尝试再次发送电子邮件。

相关内容