Postfix' '릴레이 액세스 거부'를 수정하는 방법은 무엇입니까?

Postfix' '릴레이 액세스 거부'를 수정하는 방법은 무엇입니까?

오늘 아침 보안 인증서의 이름 불일치 문제를 해결하기 위해 다음에서 권장하는 단계를 따랐습니다.메일 서버 SSL을 수정하는 방법은 무엇입니까?, 그러나 이제 클라이언트(이 경우 클라이언트는 Windows Mail임)에서 이메일을 보내려고 하면 다음 오류가 발생합니다.

거부된 이메일 주소는 '[이메일 보호됨]'. 제목 '이것은 테스트입니다. ', 계정: 'mail.domain.com', 서버: 'mail.domain.com', 프로토콜: SMTP, 서버 응답: '554 5.7.1 : 릴레이 액세스 거부됨', 포트: 25, 보안(SSL): 아니요 , 서버 오류: 554, 오류 번호: 0x800CCC79

편집하다: 이 계정에서 이메일을 계속 검색할 수 있으며 동일한 도메인의 다른 계정으로 이메일을 보냅니다. 우리 도메인 외부의 수신자에게는 이메일을 보낼 수 없습니다.

TLS를 모두 비활성화하려고 시도했지만 주사위가 없어도 여전히 같은 오류가 발생합니다.

file 을 확인하면 mail.log다음이 표시됩니다.

Jul 18 08:24:41 company imapd: LOGIN, [email protected], ip=[::ffff:111.111.11.11], protocol=IMAP
Jul 18 08:24:42 company imapd: DISCONNECTED, [email protected], ip=[::ffff:111.111.11.11], headers=0, body=0, rcvd=83, sent=409, time=1
Jul 18 08:25:19 company postfix/smtpd[29282]: connect from company.university.edu[111.111.11.11]
Jul 18 08:25:19 company postfix/smtpd[29282]: NOQUEUE: reject: RCPT from company.university.edu[111.111.11.11]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<UserPC>
Jul 18 08:25:19 company postfix/smtpd[29282]: disconnect from company.university.edu[111.111.11.11]
Jul 18 08:25:22 company imapd: DISCONNECTED, [email protected], ip=[::ffff:111.111.11.11], headers=13, body=142579, rcvd=3289, sent=215892, time=79

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

#
# Postfix MTA Manager Main Configuration File;
#
# Please do NOT edit this file manually;
#

#
# Postfix directory settings; These are critical for normal Postfix MTA functionallity;
#

command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix

#
# Some common configuration parameters;
#

inet_interfaces = all
mynetworks = 127.0.0.0/8
mynetworks_style = host

myhostname = mail.domain.com
mydomain = domain.com
myorigin = $mydomain

smtpd_banner = $myhostname ESMTP 2.4.7.1 (Debian/GNU)
setgid_group = postdrop

#
# Receiving messages parameters;
#

mydestination = localhost, company 
append_dot_mydomain = no
append_at_myorigin = yes
transport_maps = mysql:/etc/postfix/transport.cf

#
# Delivering local messages parameters;
#

mail_spool_directory = /var/spool/mail
mailbox_size_limit = 0
mailbox_command = procmail -a "$EXTENSION"

biff = no

alias_database = hash:/etc/aliases

local_recipient_maps =

#
# Delivering virtual messages parameters;
#
virtual_mailbox_maps=mysql:/etc/postfix/mysql_virt.cf
virtual_uid_maps=mysql:/etc/postfix/uids.cf
virtual_gid_maps=mysql:/etc/postfix/gids.cf
virtual_mailbox_base=/usr/local/virtual
virtual_maps=mysql:/etc/postfix/virtual.cf
virtual_mailbox_domains=mysql:/etc/postfix/virtual_domains.cf


#
# SASL paramters;
#
smtp_use_tls = yes
smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s

smtp_tls_CAfile = /etc/postfix/ssl/smptd.pem
smtp_tls_cert_file = /etc/postfix/ssl/smptd.crt
smtp_tls_key_file = /etc/postfix/ssl/smptd.key

smtpd_tls_CAfile = /etc/postfix/ssl/smptd.pem
smtpd_tls_cert_file = /etc/postfix/ssl/smptd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smptd.key

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain =

broken_sasl_auth_clients = yes

smtpd_sender_restrictions =
        permit_sasl_authenticated
        permit_mynetworks

smtpd_recipient_restrictions =
        permit_sasl_authenticated
        check_recipient_access hash:/etc/postfix/filtered_domains
        permit_mynetworks
        reject_unauth_destination

참고로, 제 고용주는 로컬 네트워크 내부와 외부 모두에서 클라이언트(Thunderbird 및 Outlook)로부터 이메일을 보낼 수 있기를 원합니다.

답변1

TLS는 smtp 세션에서 암호화를 활성화할 뿐이며 Postfix의 메시지 릴레이 허용 여부에 직접적인 영향을 미치지 않습니다.

smtpd_recipient_restrictions규칙이 일치하지 않아 릴레이 거부 메시지가 발생합니다 . 메시지가 통과하려면 다음 조건 중 하나가 충족되어야 합니다.

smtpd_recipient_restrictions =
    permit_sasl_authenticated
    check_recipient_access hash:/etc/postfix/filtered_domains
    permit_mynetworks
    reject_unauth_destination

해당 규칙을 설명하려면 다음을 수행하세요.

permit_sasl_authenticated

SASL을 통해 인증된 발신자를 허용합니다. 이는 일반적으로 차단되는 네트워크 외부의 사용자를 인증하는 데 필요합니다.

check_recipient_access

이렇게 하면 postfix가 /etc/postfix/filtered_domains수신자 주소를 기반으로 규칙을 검색하게 됩니다. (파일명으로 판단하면 특정 도메인만 차단하고 있는 것 같은데... gmail.com이 들어가 있는지 확인해 보세요.)

permit_mynetworks

이렇게 하면 에 지정된 IP 범위와 일치하는 IP 주소로 호스트가 허용됩니다 $mynetworks. 게시한 main.cf에서는 $mynetworks가 로 설정되어 있으므로 127.0.0.1서버 자체에서 생성된 이메일만 릴레이합니다.

해당 구성에 따라 메일 클라이언트는 메시지 릴레이를 허용하기 전에 SMTP 인증을 사용해야 합니다. SASL이 어떤 데이터베이스를 사용하고 있는지 잘 모르겠습니다. 에 명시되어 있습니다 /usr/lib/sasl2/smtpd.conf. 아마도 가상 메일함과 동일한 데이터베이스를 사용하므로 메일 클라이언트에서 SMTP 인증을 활성화하고 모든 설정을 완료할 수 있어야 합니다.

답변2

smtpd_use_tls = no

TLS를 비활성화했으므로 이제 에 추가하여 로컬 네트워크를 승인해야 합니다 mynetworks. 예를 들어,

mynetworks = 192.168.1.0/24 127.0.0.0/8

그러면 로컬 네트워크에서만 전송이 수정됩니다. 로컬 네트워크 외부에서 이메일을 보내려면 TLS 인증이 작동해야 합니다.

답변3

mydestination의 domain.com이 그리운 것 같습니다. 기본값이 이므로 relay_domains=$mydestination다음 구성 줄을 추가할 수 있습니다.

mydestinations = $mydomain, $myhostname, localhost, localhost.localdomain

또는:

relay_domains = $mydomain

service postfix restartpostfix conf 파일을 편집할 때마다 postfix 서버( )를 다시 시작하는 것을 잊지 마십시오 .

답변4

저는 Outlook(dovecote 및 postfix 백엔드 포함)에서 동일한 문제를 겪었고 솔루션을 찾고 구성 파일을 조정하는 데 이틀을 보냈습니다. 내가 해야 할 일은 Outlook의 메일 설정에 있는 발신 탭에서 "서버 인증 필요"를 확인하는 것뿐이었고 이제 메시지가 Gmail로 전송되었습니다. 여기에서 설정을 찾는 방법에 대한 자세한 지침을 참조하세요.http://support.bluetie.com/node/440.

관련 정보