%20%D0%B2%20postfix%3F.png)
Я включил порт 465, раскомментировав следующие строки в master.cf:
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:
$mail->isSMTP();
$mail->Host = 'example.com';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
$mail->Port = 465;
$mail->SMTPAutoTLS = false;
main.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