가상 도메인 매핑

가상 도메인 매핑

내 Gmail 계정에서 가상 도메인의 계정으로 이메일을 보내 PostFix 설정을 테스트하고 있습니다. Postfix의 응답은 변함없이 다음과 같습니다.

NOQUEUE: reject: RCPT from mail-lb0-f177.google.com[209.85.217.177]: 454 4.7.1 <mailATbrokkr.net>: Relay access denied; from=<madspayATgmail.com> to=<mailATbrokkr.net> proto=ESMTP helo=<mail-lb0-f177.google.com>

main.cf 구성 파일은 다음과 같습니다.

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/nginx/certs/madsmide_ssl-unified.crt
smtpd_tls_key_file = /etc/nginx/certs/madsmide_ssl.key
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
#smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
#smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination

# host configuration
myhostname = mail.madsmi.de
#myorigin = /etc/mailname
mydomain = madsmi.de
myorigin = $mydomain

# Local domain mapping
#alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
#mydestination = localhost
mydestination =

# Virtal domain mapping
virtual_mailbox_domains = hash:/etc/postfix/my_virtual_mailbox_domains
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = hash:/etc/postfix/my_virtual_mailbox_maps
virtual_uid_maps = static:128
virtual_gid_maps = static:142
#virtual_alias_maps = hash:/etc/postfix/virtual

# Unknown
#relayhost = 
mailbox_size_limit = 1000000000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

my_virtual_mailbox_domains 파일은 다음과 같습니다.

madsmi.de
#madskas.dk
brokkr.net

my_virtual_mailbox_maps 파일:

mailATmadsmi.de          madsmi.de/mail/
mailATbrokkr.net         brokkr.net/mail/

다음은 한 번의 연결 시도에 대한 보다 자세한 디버그 로그입니다.

Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: send attr request = seed
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: send attr size = 32
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: private/tlsmgr: wanted attribute: status
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: input attribute name: status
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: input attribute value: 0
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: private/tlsmgr: wanted attribute: seed
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: input attribute name: seed
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: input attribute value: h+12lK71F0Vgl8z8GN3zJmF2Sgcja/Y7rqFz1BV4raw=
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: private/tlsmgr: wanted attribute: (list terminator)
Jun 20 22:59:09 THEMINT postfix/smtpd[10294]: input attribute name: (end)
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: < mail-lb0-f180.google.com[209.85.217.180]: EHLO mail-lb0-f180.google.com
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_list_match: mail-lb0-f180.google.com: no match
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_list_match: 209.85.217.180: no match
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250-mail.madsmi.de
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250-PIPELINING
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250-SIZE 10240000
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250-VRFY
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250-ETRN
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250-ENHANCEDSTATUSCODES
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250-8BITMIME
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250 DSN
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: < mail-lb0-f180.google.com[209.85.217.180]: MAIL FROM:<madspayATgmail.com> SIZE=4079
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: extract_addr: input: <madspayATgmail.com>
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: smtpd_check_addr: addr=madspayATgmail.com
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: ctable_locate: move existing entry key madspayATgmail.com
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: extract_addr: in: <madspayATgmail.com>, result: madspayATgmail.com
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: smtpd_check_rewrite: trying: permit_inet_interfaces
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: permit_inet_interfaces: mail-lb0-f180.google.com 209.85.217.180
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: fsspace: .: block size 4096, blocks free 37725053
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: smtpd_check_queue: blocks 4096 avail 37725053 min_free 0 msg_size_limit 10240000
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 250 2.1.0 Ok
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: < mail-lb0-f180.google.com[209.85.217.180]: RCPT TO:<mailATmadsmi.de>
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: extract_addr: input: <mailATmadsmi.de>
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: smtpd_check_addr: addr=mailATmadsmi.de
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: ctable_locate: move existing entry key mailATmadsmi.de
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: extract_addr: in: <mailATmadsmi.de>, result: mailATmadsmi.de
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: >>> START Recipient address RESTRICTIONS <<<
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: generic_checks: name=permit_mynetworks
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: permit_mynetworks: mail-lb0-f180.google.com 209.85.217.180
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostname: mail-lb0-f180.google.com ~? 127.0.0.0/8
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostaddr: 209.85.217.180 ~? 127.0.0.0/8
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostname: mail-lb0-f180.google.com ~? [::ffff:127.0.0.0]/104
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostaddr: 209.85.217.180 ~? [::ffff:127.0.0.0]/104
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostname: mail-lb0-f180.google.com ~? [::1]/128
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostaddr: 209.85.217.180 ~? [::1]/128
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_list_match: mail-lb0-f180.google.com: no match
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_list_match: 209.85.217.180: no match
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: generic_checks: name=permit_mynetworks status=0
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: generic_checks: name=permit_sasl_authenticated
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: generic_checks: name=permit_sasl_authenticated status=0
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: generic_checks: name=defer_unauth_destination
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: reject_unauth_destination: mailATmadsmi.de
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: permit_auth_destination: mailATmadsmi.de
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: ctable_locate: leave existing entry key mailATmadsmi.de
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: NOQUEUE: reject: RCPT from mail-lb0-f180.google.com[209.85.217.180]: 454 4.7.1 <mailATmadsmi.de>: Relay access denied; from=<madspayATgmail.com> to=<mailATmadsmi.de> proto=ESMTP helo=<mail-lb0-f180.google.com>
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: generic_checks: name=defer_unauth_destination status=2
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: >>> END Recipient address RESTRICTIONS <<<
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 454 4.7.1 <mailATmadsmi.de>: Relay access denied
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: < mail-lb0-f180.google.com[209.85.217.180]: DATA
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 554 5.5.1 Error: no valid recipients
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: < mail-lb0-f180.google.com[209.85.217.180]: QUIT
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: > mail-lb0-f180.google.com[209.85.217.180]: 221 2.0.0 Bye
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostname: mail-lb0-f180.google.com ~? 127.0.0.0/8
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostaddr: 209.85.217.180 ~? 127.0.0.0/8
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostname: mail-lb0-f180.google.com ~? [::ffff:127.0.0.0]/104
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostaddr: 209.85.217.180 ~? [::ffff:127.0.0.0]/104
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostname: mail-lb0-f180.google.com ~? [::1]/128
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_hostaddr: 209.85.217.180 ~? [::1]/128
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_list_match: mail-lb0-f180.google.com: no match
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: match_list_match: 209.85.217.180: no match
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: send attr request = disconnect
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: send attr ident = smtp:209.85.217.180
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: private/anvil: wanted attribute: status
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: input attribute name: status
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: input attribute value: 0
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: private/anvil: wanted attribute: (list terminator)
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: input attribute name: (end)
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: disconnect from mail-lb0-f180.google.com[209.85.217.180]
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: master_notify: status 1
Jun 20 22:59:10 THEMINT postfix/smtpd[10294]: connection closed

내 질문은: 왜 메일이 거부되나요? 로그에서 수집할 수 있는 정보에 따르면 발신자(google.com)가 원하는 것이 발견되거나 수신자(이 경우 madsmi.de의 메일)가 인식되지 않습니다.

첫 번째라면 호스트가 목적지이고 메일을 보내라는 요청을 받지 않고 전달하라는 요청을 받는 경우 왜 릴레이 규칙이 적용되는지 혼란스럽습니다. 두 번째인 경우 PostFix가 virtual_mailbox_maps의 수신자를 볼 수 없는 이유는 무엇입니까?

답변1

아래의 "해시:"로 인해 문제가 발생하므로 이를 제거하면 통과됩니다.

가상 도메인 매핑

virtual_mailbox_domains = 해시:/etc/postfix/my_virtual_mailbox_domains

답변2

mydestination은 비워둘 수 없습니다. 이 필드가 비어 있기 때문에 메일 서버가 메일 대상을 찾을 수 없습니다. 본질적으로 NOQUEUE는 갈 곳이 없습니다. 나는 이것을 mydestination = 127.0.0.1로 설정하거나 심지어 localhost도 잘 작동할 것입니다. defer_unauth_destination은 백업 MX 서버로도 설정되지 않았음을 의미합니다. mydestination이 비어 있어야 하는 유일한 경우는 백업 MX 서버 역할을 하는 경우입니다. 이 경우 백업 역할을 수행할 서버로 Relayhost를 설정해야 합니다.

6월 20일 22:59:10 THEMINT postfix/smtpd[10294]: NOQUEUE: 거부: mail-lb0-f180.google.com[209.85.217.180]의 RCPT: 454 4.7.1: 릴레이 액세스가 거부되었습니다. from= to= proto=ESMTP helo= 6월 20일 22:59:10 THEMINT postfix/smtpd[10294]: generic_checks: name=defer_unauth_destination status=2 6월 20일 22:59:10 THEMINT postfix/smtpd[10294]: >>> END 수신자 주소 RESTRICTIONS <<<

관련 정보