后缀:收件人地址被拒绝:本地收件人表中的用户未知,即使收件人域是外部域


9

在我的公司基础结构中,我有一个带后缀的内部邮件服务器,其名称为srv-internal.central.mydomain.tld,内部IP为10.10.128.200。

为了与Net交换邮件,它使用中继邮件服务器(DMZ环境中的服务器,该服务器具有所有需要的针孔,例如..),甚至带有名称为mailgw.central.mydomain.tld的后缀,其内部接口IP为10.10。 133.105

我们的基础结构的公共域名是(例如)“ central.mydomain.tld ”,但是“ pec.central.mydomain.tld ”不是我们的子域。它是由我们网络之外的另一个ISP提供的(因此,发送到该域的邮件必须退出)。

如果我从user1@central.mydomain.tld(从srv-internal.central.mydomain.tld计算机)发送邮件到foo@pec.central.mydomain.tld,我从中继服务器收到以下错误:

Sep  4 08:03:16 mailgw postfix/smtpd[26678]: NOQUEUE: reject: RCPT from unknown[10.10.128.200]: 550 5.1.1 <foo@pec.central.mydomain.tld>: Recipient address rejected: User unknown in relay recipient table; from=<user1@central.mydomain.tld> to=<foo@pec.central.mydomain.tld> proto=ESMTP helo=<srv-internal.central.mydomain.tld>
Sep  4 08:03:16 mailgw postfix/smtpd[26678]: disconnect from unknown[10.10.128.200]

我的中继服务器在Linux CentOS版本5.7上,后缀版本是标准CentOS存储库中的postfix-2.3.3-2.1.el5_2。

假设我的域名是:

 mydomain = central.mydomain.tld

我目前在中继服务器上的postfix配置如下:

(postconf -d; postconf -d; postconf -n;)| 排序| uniq -u

alias_maps = hash:/etc/aliases
biff = no
body_checks = regexp:/etc/postfix/body_checks
content_filter = filter:127.0.0.1:10025
default_process_limit = 10
disable_vrfy_command = yes
header_checks = pcre:/etc/postfix/header_checks
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 12582912
mime_header_checks = regexp:/etc/postfix/mime_header_checks
mydestination = $myhostname, localhost.$mydomain
myhostname = mailgw.$mydomain
mynetworks = 127.0.0.0/8, 10.10.24.0/24, 10.10.128.200/32, 10.10.128.201/32
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /etc/postfix/README_FILES
receive_override_options = no_address_mappings
relay_domains = $mydomain, riminiventure.it
relay_recipient_maps = hash:/etc/postfix/relay_recipients
sample_directory = /etc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
smtpd_error_sleep_time = 5s
smtpd_hard_error_limit = 10
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks,    permit_sasl_authenticated,    check_client_access hash:/etc/postfix/access_client,    check_helo_access hash:/etc/postfix/access_helo,    check_sender_access hash:/etc/postfix/access_sender, pcre:/etc/postfix/access_sender_pcre,    check_recipient_access hash:/etc/postfix/access_recipient,    reject_unauth_destination,    reject_invalid_hostname,    reject_unauth_pipelining,    reject_non_fqdn_sender,    reject_unknown_sender_domain,    reject_non_fqdn_recipient,    reject_unknown_recipient_domain,    reject_rbl_client bl.spamcop.net,    reject_rbl_client sbl.spamhaus.org,  check_policy_service inet:127.0.0.1:2501,    permit
smtpd_soft_error_limit = 3
strict_rfc821_envelopes = yes
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 450
virtual_alias_domains = riminifar.it
virtual_alias_maps = hash:/etc/postfix/virtual

这是我的/ etc / postfix / transport:

central.mydomain.tld        smtp:[srv-internal.central.mydomain.tld]
someotherdomain.org         smtp:[srv-internal.central.mydomain.tld]
yadomain.it                  smtp:[srv-internal.central.mydomain.tld]
xad.central.mydomain.tld        smtp:[srv-internal.central.mydomain.tld]
test.central.mydomain.tld        smtp:[10.10.15.101]

现在,收件人地址已被拒绝:中继收件人表中的未知用户似乎中继服务器(mailgw)“认为”“ pec.central.mydomain.tld”是其子域之一,因此它在其中继_收件人_地图中搜索收件人用户,不应该恕我直言。

如果我在传输表中放入“ .central.mydomain.tld”(带有初始点!),我会期望这种行为,但是我确实有“ central.mydomain.tld”,因此,阅读手册时,它应该仅考虑域名,而不是子域。

如果有人可以建议我做错了事,我将不胜感激。

Answers:


6

您应该注意的参数是parent_domain_matches_subdomains

Postfix功能列表,其中模式“ example.com”也与example.com的子域匹配,而不需要显式的“ .example.com”模式。这是计划的向后兼容性:最终,当您真正想要匹配子域时,所有Postfix功能都需要显式的“ .example.com”样式模式。

因此,parent_domain_matches_subdomains包含后缀也应与其子域相匹配的域列表,即使其前面没有(点)

不幸的是,relay_domains参数属于该列表。

# postconf parent_domain_matches_subdomains
parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_domains,smtpd_access_maps

并且由于您的relay_domainscontains $mydomaincentral.mydomain.tld,后缀匹配central.mydomain.tld的所有子域,而relay_domains不是外部的。


解决方案已设置,parent_domain_matches_subdomains并且在这些参数上不包括relay_domains。


非常感谢,@ masegaloeh。Tnx也非常清楚您的解释。
gabolander 2014年

@gabolander如果可行,请考虑接受此答案,因此问题不会浮在未回答的问题中
masegaloeh 2014年

我已经做到了,谢谢。(我不能说它有用,因为我需要15个声誉,而我还没有)
gabolander 2014年

0

在我的情况下,我在/ etc / postfix / relay_recipients下找到了电子邮件用户的白名单。如果您的用户不在这些列表中,他将永远不会收到电子邮件。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.