Подключаем SSL на Postfix CentOS

1. Ставим ПО для генерации SSL сертификата

yum install crypto-utils

2. Генерируем сертификат

genkey —days 365 mail.domain.com

3. Подключаем SSL ( STARTTLS ) к postfix

nano /etc/postfix/main.cf
smtpd_tls_security_level = may
smtpd_tls_key_file = /etc/pki/tls/private/mail.domain.com.key
smtpd_tls_cert_file = /etc/pki/tls/certs/mail.domain.com.cert
# smtpd_tls_CAfile = /etc/pki/tls/root.crt
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache
tls_random_source = dev:/dev/urandom
smtpd_tls_auth_only = yes

4. Ребутаем сервис

service postfix restart

Проверяем :

[root@postfix]# telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.
Escape character is '^]'.
220 hosterbit.ru ESMTP Postfix
ehlo example.com
250-example.ru
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Как видите, STARTTLS используется принудительно.

Tags: , , ,

Leave a Reply