외부 호스트에 대한 Postfix smtp 메일은 불가능합니다.

외부 호스트에 대한 Postfix smtp 메일은 불가능합니다.

웹서버와 메일서버를 운영하는 서버(Ubuntu 12.04 LTS)를 관리하고 있습니다. - 웹서버는 잘 돌아가는데 메일서버에 문제가 있습니다. Dovecot을 올바르게 설치하고 구성했습니다. Thunderbird로 연결할 수 있고(내 클라이언트가 다른 네트워크에 있으므로 내부 네트워크가 아님) 모든 폴더 등을 볼 수 있습니다. 외부로부터의 메일도 수신됩니다.

Postfix smtp 인증이 작동하는 것 같습니다(STARTTLS 사용). 외부 네트워크의 Thunderbird에서 로컬 호스트 및 서버 도메인으로 이메일을 쓸 수 있기 때문입니다. 하지만 Gmail과 같은 다른 주소로 이메일을 보내려고 하면 다음 오류가 발생합니다.

An error occurred while sending mail. The mail server responded:  5.7.1 <***@gmail.com>:
Relay access denied. Please check the message recipient ***@gmail.com and try again.

나는 postfix 자체에서 smtp 릴레이를 사용합니다. ssh로 로그인하면 이메일을 쓸 수 있습니다. 문제는 여기 어딘가에 있다고 생각합니다. postfix에 대한 smtp 연결도 이 구성된 릴레이를 사용합니까?

내 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_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 = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.com, localhost, myhostname
relayhost = smtp.myrelayhoster.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all



smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noplaintext noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password

sender_canonical_maps = hash:/etc/postfix/sender_canonical

말했듯이 기본 smtp 인증이 작동하는 것 같습니다. smtp에 대해 릴레이를 별도로 구성해야 합니까?

다음은 /var/log/mail.log의 중요한 줄입니다:

Sep  5 09:19:21 myhostname postfix/smtpd[9086]: connect from isp-ip.net[123.456.789.123]
Sep  5 09:19:22 myhostname postfix/smtpd[9086]: NOQUEUE: reject: RCPT from isp-ip.net[123.456.789.123]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<thunderbird>
Sep  5 09:19:22 myhostname postfix/smtpd[9086]: disconnect from isp-ip.net[123.456.789.123]

답변1

Sep  5 09:19:22 myhostname postfix/smtpd[9086]: NOQUEUE: reject: RCPT from isp-ip.net[123.456.789.123]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<thunderbird>

텔넷을 통해 smtp 세션을 에뮬레이트하고 질문에 출력을 추가해 보십시오. 또한 swaks를 사용할 수도 있습니다. 이는 단지 Perl 스크립트일 뿐입니다.

# swaks -s isp-ip.net --helo thunderbird --to [email protected] --from [email protected] --auth PLAIN --auth-user [email protected] --auth-password 7654321 --auth-hide-password

호스트가 인증을 광고하지 않았습니다.

릴레이 호스트가 인증을 지원하지 않는 것 같습니다. 그럴 수도 있지만 암호화된 채널을 통해서만 가능합니다. 대신 465/587 포트를 사용해 보십시오. 예를 들어

# swaks -s isp-ip.net -tlsc -p 465 --helo thunderbird --to [email protected] --from [email protected] --auth PLAIN --auth-user [email protected] --auth-password 7654321 --auth-hide-password

# swaks -s isp-ip.net -tls -p 587 --helo thunderbird --to [email protected] --from [email protected] --auth PLAIN --auth-user [email protected] --auth-password 7654321 --auth-hide-password

관련 정보