2.2. Customizing TLS settings of a Postfix server
To make your email traffic encrypted and therefore more secure, you can configure Postfix to use a certificate from a trusted certificate authority (CA) instead of the self-signed certificate and customize the Transport Layer Security (TLS) security settings. By default, the TLS encryption protocol is enabled in the Postfix server. The basic Postfix TLS configuration contains self-signed certificates for inbound SMTP and the opportunistic TLS for outbound SMTP.
Prerequisites
- You have the root access.
-
You have the
postfixpackage installed on your server. - You have a certificate signed by a trusted certificate authority (CA) and a private key.
You have copied the following files to the Postfix server:
-
The server certificate:
/etc/pki/tls/certs/postfix.pem -
The private key:
/etc/pki/tls/private/postfix.key
-
The server certificate:
- If the FIPS mode is enabled, clients must either support the Extended Master Secret (EMS) extension or use TLS 1.3. TLS 1.2 connections without EMS fail. For more information, see the Red Hat Knowledgebase solution TLS extension "Extended Master Secret" enforced.
Procedure
Set the path to the certificate and private key files on the server where Postfix is running by adding the following lines to the
/etc/postfix/main.cffile:smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem smtpd_tls_key_file = /etc/pki/tls/private/postfix.keyRestrict the incoming SMTP connections to authenticated users only by editing the
/etc/postfix/main.cffile:smtpd_tls_auth_only = yesReload the
postfixservice to apply the changes:# systemctl reload postfix
Verification
Configure your client to use TLS encryption and send an email.
注意To get additional information about Postfix client TLS activity, increase the log level from
0to1by changing the following line in the/etc/postfix/main.cf:smtp_tls_loglevel = 1