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 postfix package 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
  • 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

  1. 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.cf file:

    smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
    smtpd_tls_key_file = /etc/pki/tls/private/postfix.key
  2. Restrict the incoming SMTP connections to authenticated users only by editing the /etc/postfix/main.cf file:

    smtpd_tls_auth_only = yes
  3. Reload the postfix service 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 0 to 1 by changing the following line in the /etc/postfix/main.cf:

    smtp_tls_loglevel = 1
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部