Swop / Install TLS Certificate for Postfix

Questions and answers about how to do stuff
Post Reply
Ben89
Posts: 1
Joined: 03 May 2018 20:03

Swop / Install TLS Certificate for Postfix

Post by Ben89 »

Hello,
I just did this and it worked fine so I thought I share it.

Start FileZilla SFTP (PORT 22) connect as admin. Copy Certificate (I copied my Certificate from a different LINUX machine so I had it a CRT and KEY file) in Home Folder. Best you create a folder for it like /home/admin/certs/2018.

Certificate is now under /home/admin/certs/2018

SSH -> Shell -> SU

Now u only have to adjust the path in the main.cf file to the new Certificate files:

Code: Select all

vi /etc/postfix/main.cf
Original File Content:

Code: Select all

smtp_tls_CAfile = /etc/postfix/ssl/rsa_smtpd.pem
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/rsa_smtpd.pem
smtpd_tls_cert_file = /etc/postfix/ssl/rsa_smtpd.pem
smtpd_tls_CAfile = /etc/postfix/ssl/rsa_smtpd.pem
After changing the path to the new Certificate files:

Code: Select all

# smtp_tls_CAfile = /etc/postfix/ssl/rsa_smtpd.pem
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /home/admin/certs/2018/keyfile.key
smtpd_tls_cert_file = /home/admin/certs/2018/certificate.crt
# smtpd_tls_CAfile = /etc/postfix/ssl/rsa_smtpd.pem
And now

Code: Select all

/etc/init.d/postfix restart
Test it via. https://www.checktls.com

Hope it helps someone!
Post Reply