Cài đặt SSL trên Postfix

  Download file CA Bundle theo CA mà chứng chỉ của bạn đã đăng kí với tên ca-bundle.crt

cat ca-bundle.crt > /etc/ssl/certs/ca-bundle.crt
chmod 644 /etc/ssl/certs/ca-bundle.crt
cat /etc/ssl/certs/mail_certificate.pem > /etc/ssl/certs/postfix.pem
cat /etc/ssl/private/mail_privatekey.pem > /etc/ssl/private/postfix.pem
chown root:ssl-cert /etc/ssl/private/postfix.pem
chmod 644 /etc/ssl/private/postfix.pem
chown root:root /etc/ssl/certs/postfix.pem
chmod 444 /etc/ssl/certs/postfix.pem/usr/local/ssl/certificate/certificate.crt

Thêm các option sau vào config của Postfix (thường là /etc/postfix/main.cf).

    smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
    smtp_tls_cert_file = /etc/ssl/certs/postfix.pem
    smtp_tls_key_file = /etc/ssl/private/postfix.pem
    smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
    smtp_use_tls = yes
      
    smtpd_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
    smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem
    smtpd_tls_key_file = /etc/ssl/private/postfix.pem
    smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cache
    smtpd_use_tls = yes
     
    smtpd_tls_received_header = yes
    smtpd_tls_loglevel = 1
    smtpd_tls_auth_only = no
    tls_random_source = dev:/dev/urandom

Restart lại Postfix và telnet thử để kiểm tra TLS :

telnet mail.example.org 25

Thông tin Postfix khi vừa telnet.

Trying 127.0.0.1...
Connected to mail.example.org.
Escape character is '^]'.
220 mail.example.com NO UCE ESMTP 

Dùng lệnh EHLO 

EHLO test.com

Kiểm tra xem Server có trả về thông tin 250-STARTTLS.

250-mail.example.org
250-PIPELINING
250-SIZE 52428800
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Dùng lệnh STARTTLS 

STARTTLS

Nếu Mail Server trả về kết quả sau, setup SSL thành công.

220 2.0.0 Ready to start TLS
  • 0 Người dùng thấy hướng dẫn này hữu ích
Hướng dẫn này có hữu ích?

Những hướng dẫn liên quan

Cài đặt SSL trên Microsoft Lync 2010

Để cài đặt chứng thư số SSL cho Microsoft Lync 2010, bạn thực hiện như sau: Bước 1: Copy 2 files...

Cài đặt SSL trên Apache Linux

Để cài đặt chứng thư số SSL lên Apache trên Linux, bạn thực hiện như sau: 1. Giải nén file đính...

Cài đặt SSL trên Microsoft Exchange 2010

Để cài đặt chứng thư số SSL cho Exchange Server 2010, bạn thực hiện như sau :  Bước 1: Copy 2...

Cài đặt SSL trên IIS 10 (Windows Server 2016)

Install First SSL Certificate Do this first set of instructions only once, for the first SSL...

Cài đặt SSL trên WHM (Web Host Manager)

   Log in to your WHM account. Once you logged in, find the option ‘Install an SSL certificate...