2.6. Configuring Postfix as an outgoing mail server to relay for authenticated users


You can configure Postfix to relay mail for authenticated users. In this scenario, you allow users to authenticate themselves and use their email address to send mail through your SMTP server by configuring Postfix as an outgoing mail server with SMTP authentication, TLS encryption, and sender address restrictions.

Prerequisites

  • You have the root access.
  • You have configured a Postfix server.

Procedure

  1. To configure Postfix as an outgoing mail server, edit the /etc/postfix/main.cf file and add the following:

    1. Enable SMTP authentication:

      smtpd_sasl_auth_enable = yes
      broken_sasl_auth_clients = yes
    2. Disable access without TLS:

      smtpd_tls_auth_only = yes
    3. Allow mail relaying only for authenticated users:

      smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
    4. Optional: Restrict users to use their own email address only as a sender:

      smtpd_sender_restrictions = reject_sender_login_mismatch
  2. Reload the postfix service to apply the changes:

    # systemctl reload postfix

Verification

  • Authenticate in your SMTP client that supports TLS and SASL. Send an test email to verify that the SMTP authentication works correctly.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部