![Postfix 不会接收虚拟域的电子邮件](https://linux22.com/image/668796/Postfix%20%E4%B8%8D%E4%BC%9A%E6%8E%A5%E6%94%B6%E8%99%9A%E6%8B%9F%E5%9F%9F%E7%9A%84%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6.png)
我已经搜索解决方案 3 天了,但似乎毫无用处。Postfix 可以从服务器正常发送电子邮件,但无法接收电子邮件。每次我尝试向某个虚拟域发送电子邮件时,都会收到“中继访问被拒绝”的提示
这是 postfix 配置:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
邮件日志:
Oct 14 08:42:44 ns519796 postfix/smtpd[19172]: connect from mail-yk0-f177.google.com[209.85.160.177]
Oct 14 08:42:44 ns519796 postfix/smtpd[19172]: NOQUEUE: reject: RCPT from mail-yk0-f177.google.com[209.85.160.177]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-yk0-f177.google.com>
Oct 14 08:42:44 ns519796 postfix/smtpd[19172]: disconnect from mail-yk0-f177.google.com[209.85.160.177]
答案1
mydestination 是否包含您的 example.com?
mydestination = example.com, $myhostname, localhost.$mydomain, localhost
中继访问被拒绝不是每个邮箱的错误,它表示您正在寻找的域名不被接受,并假定您想要中继到该域名(因为它不是本地域名)
别名映射的问题可能与诸如邮箱未找到错误之类的问题有关,而不是中继错误。
电子邮件地址错误:
rcpt to:[email protected]
554 5.7.1 <[email protected]>: Recipient address rejected: Access denied
域错误:
rcpt to:[email protected]
454 4.7.1 <[email protected]>: Relay access denied