%EB%A5%BC%20%EA%B5%AC%EC%84%B1%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
master.cf에서 다음 줄의 주석 처리를 제거하여 포트 465를 활성화했습니다.
smtps inet n - y - - smtpd
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_recipient=no
-o smtpd_client_restrictions=$mua_client_restrictions
-o smtpd_helo_restrictions=$mua_helo_restrictions
-o smtpd_sender_restrictions=$mua_sender_restrictions
그리고 포트 465가 활성화되었습니다. 하지만 PHPMailer를 사용하여 SSL을 사용하여 연결하면 연결할 수 없다는 메시지가 나타납니다. 하지만 STARTTLS를 사용하면 작동합니다. 왜 그런 겁니까? SSL을 사용하여 연결하면 작동한다고 생각합니다. 어떤 해결책을 주시겠습니까?
PHPMailer conf:
$mail->isSMTP();
$mail->Host = 'example.com';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
$mail->Port = 465;
$mail->SMTPAutoTLS = false;
메인.cf:
# TLS configuration starts here
tls_random_source = dev:/dev/urandom
# SMTP from your server to others
smtp_tls_key_file = /some/place/to/ssl/domain.key
smtp_tls_cert_file = /some/place/to/ssl/domain.crt
smtp_tls_CAfile = /some/place/to/ssl/domain.crt
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
smtp_tls_mandatory_protocols=!SSLv2,!SSLv3,!TLSv1,!TLSv1.1
smtp_tls_protocols=!SSLv2,!SSLv3,!TLSv1,!TLSv1.1
smtp_tls_loglevel = 0
smtp_tls_session_cache_database =
btree:/var/lib/postfix/smtp_tls_session_cache
# SMTP from other servers to yours
smtpd_tls_key_file = /some/place/to/ssl/domain.key
smtpd_tls_cert_file = /some/place/to/ssl/domain.crt
smtpd_tls_CAfile = /some/place/to/ssl/domain.crt
smtpd_tls_security_level = encrypt
smtpd_tls_auth_only = yes
smtpd_tls_mandatory_protocols=!SSLv2,!SSLv3,!TLSv1,!TLSv1.1
smtpd_tls_protocols=!SSLv2,!SSLv3,!TLSv1,!TLSv1.1
smtpd_tls_loglevel = 0
smtpd_tls_session_cache_database =
btree:/var/lib/postfix/smtpd_tls_session_cache
# TLS configuration ends here