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 Glassfish / JBoss / Tomcat / Java Servers

Quá trình cài đặt hơi khác tùy thuộc vào định dạng của chứng chỉ mà bạn nhận được từ một...

Cài đặt SSL trên Cpanel

Đăng nhập vào tài khoản cPanel của bạn Xác định vị trí và bấm vào SSL/TLS Manager trong phần...

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

Để cài đặt chứng thư số SSL cho Microsoft Exchange 2003, bạn cần dùng hướng dẫn cài đặt áp dụng...

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...

Hướng dẫn chuyển từ HTTP sang HTTPS trong IIS

Method 1: Using IIS URL Rewrite Module For this you will have to install the URL Rewrite module....