Postfix 中邮件无法中继

Postfix 中邮件无法中继

我正在管理一个主要使用虚拟别名映射来中继邮件的服务器。由于某些我不知道的原因,经过这些映射的电子邮件被退回。我已检查以确保域名在我的 virtual_alias_domains 表中,但它们仍然被退回。我已查阅 Postfix 网站,但一切似乎都设置正确。我该如何诊断此问题?

以下信息可能有帮助:

Aug  2 00:07:01 server2 postfix/smtpd[6729]: NOQUEUE: reject: RCPT from <sender address>: 454 4.7.1 <recipient address>: Relay access denied; from=<sender address> to=<recipient address> proto=ESMTP helo=<sender server>

# postconf -n
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases, hash:/usr/local/etc/postfix/aliases-www
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
html_directory = /usr/local/share/doc/postfix
mail_owner = postfix
mailbox_command = /usr/local/bin/procmail
mailbox_size_limit = 524288000
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 40960000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
myhostname = mymailserver.domain.com
mynetworks = #list of ip's#
myorigin = $mydomain
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/local/share/doc/postfix
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
soft_bounce = yes
unknown_local_recipient_reject_code = 450
virtual_alias_domains = hash:/usr/local/etc/postfix/virtual-alias-domains
virtual_alias_maps = hash:/usr/local/etc/postfix/virtusertable
virtual_mailbox_base = /var/mail
virtual_mailbox_limit = 524288000

答案1

# postconf -d smtpd_recipient_restrictions
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination

# postconf -d mynetworks
mynetworks = 127.0.0.0/8 <serversSubnet>

你可能想要:

smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination

或者

mynetworks = 127.0.0.0/8 <serversSubnet> <clientSubnet>

或者两者兼而有之。

答案2

所以请稍等。措辞要正确。

当你有virtual_alias_maps然后这是发送邮件到当地的邮箱,而不是为其他人转发邮件。

当您想要为其他域中继邮件时,您需要类似transport_mapsrelay_domains和 之类的东西relay_recipient_maps

http://www.postfix.org/STANDARD_CONFIGURATION_README.html举些例子。

当邮件被退回时,您的日志是什么样的?

答案3

您可能需要检查接收 SMTP 服务器是否没有阻止主题服务器。

相关内容