![Postfix가 메시지를 전달하지 않음(554 클라이언트 호스트 거부됨: 액세스 거부됨)](https://rvso.com/image/1447603/Postfix%EA%B0%80%20%EB%A9%94%EC%8B%9C%EC%A7%80%EB%A5%BC%20%EC%A0%84%EB%8B%AC%ED%95%98%EC%A7%80%20%EC%95%8A%EC%9D%8C(554%20%ED%81%B4%EB%9D%BC%EC%9D%B4%EC%96%B8%ED%8A%B8%20%ED%98%B8%EC%8A%A4%ED%8A%B8%20%EA%B1%B0%EB%B6%80%EB%90%A8%3A%20%EC%95%A1%EC%84%B8%EC%8A%A4%20%EA%B1%B0%EB%B6%80%EB%90%A8).png)
localhost의 메시지는 정상적으로 작동하지만 Gmail에서 내 도메인으로 메일을 보내려고 하면(가상 도메인 매핑에서와 같이) postfix가 오류(554 5.7.1 : 클라이언트 호스트 거부됨: 액세스 거부됨)와 함께 메일을 거부합니다.
메인.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 = ***
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
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.
myhostname = *** my hostname ***
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous noplaintext
smtpd_tls_security_level = may
virtual_alias_domains = *** my virtual alias domains ***
virtual_alias_maps = hash:/etc/postfix/virtual
smtpd_tls_auth_only = yes
smtpd_client_restrictions = permit_mynetworks, reject
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, permit
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_end_of_data_restrictions = check_policy_service unix:private/policy
smtp_sasl_auth_enable = no
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, hash:/etc/postfix/sender_access, permit
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, check_helo_access hash:/etc/postfix/sender_access, reject_non_fqdn_hostname, reject_invalid_hostname, permit
smtpd_recipient_restrictions = reject_unauth_pipelining, reject_unauth_destination, reject_non_fqdn_recipient, permit_mynetworks, permit_sasl_authenticated, check_sender_access hash:/etc/postfix/sender_access, reject_rbl_client relays.ordb.org, reject_rbl_client list.dsbl.org, reject_rbl_client sbl-xbl.spamhaus.org, check_policy_service unix:private/spfpolicy, check_policy_service inet:127.0.0.1:10023, permit
transport_maps = hash:/etc/postfix/transport
답변1
이 설정은 다음과 같습니다.
smtpd_client_restrictions = allowed_mynetworks, 거부
(combined my mynetworks
being set to localhost
)은 로컬이 아닌 연결 시도를 거부해야 함을 나타냅니다.
외부로부터의 메일을 수락하려면 그렇게 하지 말고 smtpd_client_restrictions
빈 기본값으로 두십시오.
답변2
확인해야 할 또 다른 사항: amavisd가 실행 중입니까? 일반적인 설정에서 postfix는 바이러스를 확인하기 위해 spamassassin으로 메시지를 보냅니다. amavisd가 ipv6 네트워크와 통신하려고 했기 때문에 시작하지 않을 때 질문에 메시지를 받았는데, 이 사이트에서는 비활성화되어 있습니다.