태그 보관물: postfix

postfix

접미사 :받는 사람 주소가 거부 됨 :받는 사람 도메인이 외부 도메인 인 경우에도 로컬받는 사람 테이블에서 사용자를 알 수 없음 릴리스 5.7에

회사 인프라에는 이름이 내부 IP 10.10.128.200 인 srv-internal.central.mydomain.tld 라는 접미사가있는 내부 메일 서버가 있습니다.

Net과 메일을 교환하기 위해 내부 인터페이스 IP 10.10을 가진 postgw 라는 이름의 postfix와 함께 중계 메일 서버 (예 : 필요한 모든 핀홀이있는 DMZ 환경의 서버)를 사용합니다 . 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 구성은 currenttly입니다.

(postconf -d; postconf -d; postconf -n;) | 정렬 | 유니크 -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”가 하위 도메인 중 하나 인 “생각”으로 보이므로 수신자 사용자를 relay_recipient_maps로 검색합니다. IMHO해서는 안됩니다.

전송 테이블에 “.central.mydomain.tld”(초기 점!)를 넣으면이 동작이 예상되었지만 실제로는 “central.mydomain.tld”가 있으므로 설명서를 읽으면 도메인 이름 만 고려해야합니다. 하위 도메인도 아닙니다.

누군가 내가 잘못하고있는 것을 제안 할 수 있다면 크게 감사합니다.



답변

알아야 할 매개 변수는 parent_domain_matches_subdomains 입니다.

“example.com”패턴이 명시적인 “.example.com”패턴을 요구하지 않고 “example.com”패턴이 example.com의 하위 도메인과도 일치하는 Postfix 기능 목록입니다. 하위 호환성을 원할 경우 모든 Postfix 기능에는 명시적인 “.example.com”스타일 패턴이 필요합니다.

따라서 parent_domain_matches_subdomains는 postfix 앞에도 점이없는 하위 도메인과도 일치해야하는 도메인 목록을 보유 합니다 .

불행히도 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 $mydomain또는 central.mydomain.tld 이므로 postfix는 central.mydomain.tld의 모든 하위 도메인을 relay_domains외부 도메인이 아닌 것으로 일치시킵니다 .


솔루션 이 설정 parent_domain_matches_subdomains되었으며 해당 매개 변수에 relay_domains를 포함하지 않습니다.


답변

필자의 경우 전자 메일 사용자의 허용 목록을 다음에서 찾을 수 있습니다. / etc / postfix / relay_recipients 사용자가이 목록에 없으면 전자 메일을받지 못합니다.


답변