외부 SMTP 릴레이를 통해 이메일을 보내도록 Centos 8 시스템을 구성하고 싶습니다. (Centos 박스를 제어하고 외부 릴레이를 제어할 수 없습니다.)
postfix
이 작업을 수행하도록 설정하는 방법에 대한 수많은 게시물을 읽었 지만 다음을 통해 메일을 보내십시오.
echo "Test Mail" | mailx -r [email protected] -s "from centUser" [email protected]
릴레이 호스트에 의해 거부됨:550-Please turn on SMTP Authentication in your mail client
/etc/postfix/sasl_passwd
해시 파일을 구성 하고 생성했습니다.postmap /etc/postfix/sasl_passwd
어떤 제안이 있으십니까? 게시물에 있는 모든 것을 시도했지만 아무것도 얻지 못했습니다.
postconf -n 출력
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 10
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
relayhost = [mail.relayHost.com]:465
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_security_level = encrypt
smtp_tls_wrappermode = yes
smtp_use_tls = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
smtpd_tls_key_file = /etc/pki/tls/private/postfix.key
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
/var/log/maillog 내용:
Mar 10 19:03:59 localhost postfix/pickup[51935]: C9C78A0ECC: uid=0 from=<[email protected]>
Mar 10 19:03:59 localhost postfix/cleanup[51953]: C9C78A0ECC: message-id=<6229db1f.6kZlW9/tSI+EKENo%[email protected]>
Mar 10 19:03:59 localhost postfix/qmgr[51936]: C9C78A0ECC: from=<[email protected]>, size=430, nrcpt=1 (queue active)
Mar 10 19:04:04 localhost postfix/smtp[51955]: C9C78A0ECC: to=<[email protected]>, relay=mail.relayHost.com[xxx.xxx.xxx.xxx]:465, delay=4.9, delays=0.09/0.04/1.6/3.2, dsn=5.0.0, status=bounced (host mail.relayHost.com[xxx.xxx.xxx.xxx] said: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message. 550-bc9deedb.xxx.ispdomain.com (centUser.localdomain) [yyy.yyy.yyy.yyy]:42686 550 is not permitted to relay through this server without authentication. (in reply to RCPT TO command))
Mar 10 19:04:04 localhost postfix/cleanup[51953]: D9BC8A0ECD: message-id=<[email protected]>
Mar 10 19:04:04 localhost postfix/qmgr[51936]: D9BC8A0ECD: from=<>, size=2982, nrcpt=1 (queue active)
Mar 10 19:04:04 localhost postfix/bounce[51958]: C9C78A0ECC: sender non-delivery notification: D9BC8A0ECD
Mar 10 19:04:04 localhost postfix/qmgr[51936]: C9C78A0ECC: removed
Mar 10 19:04:06 localhost postfix/smtp[51955]: D9BC8A0ECD: to=<[email protected]>, relay=mail.relayHost.com[xxx.xxx.xxx.xxx]:465, delay=1.6, delays=0.04/0/1.1/0.48, dsn=5.0.0, status=bounced (host mail.relayHost.com[xxx.xxx.xxx.xxx] said: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message. 550-bc9deedb.xxx.ispdomain.com (centUser.localdomain) [yyy.yyy.yyy.yyy]:42688 550 is not permitted to relay through this server without authentication. (in reply to RCPT TO command))
Mar 10 19:04:06 localhost postfix/qmgr[51936]: D9BC8A0ECD: removed
답변1
RelayHost=[mail.relayHost.com]:465
릴레이 호스트는 TLS를 통해 제출되는 포트 465를 사용하므로 이메일이 이 서버를 통해 릴레이되도록 하려면 반드시 인증과 TLS가 필요합니다.
리소스 섹션을 참조하세요.Postfix SMTP/LMTP 클라이언트에서 SASL 인증 활성화공식 문서에는여기에서 찾을 수 있습니다