1.6. Configuring an LMTP socket and LMTPS listener


SMTP servers, such as Postfix, use the Local Mail Transfer Protocol (LMTP) to deliver emails to Dovecot. If the SMTP server runs:

  • On the same host as Dovecot, use an LMTP socket
  • On a different host, use an LMTP service

    By default, the LMTP protocol is not encrypted. However, if you configured TLS encryption, Dovecot uses the same settings automatically for the LMTP service. SMTP servers can then connect to it by using the LMTPS protocol or the STARTTLS command over LMTP.

Prerequisites

  • Dovecot is installed.
  • If you want to configure an LMTP service, TLS encryption is configured in Dovecot.

Procedure

  1. Verify that the LMTP protocol is enabled:

    # doveconf -a | grep -E "^protocols"
    protocols = imap pop3 lmtp

    The protocol is enabled, if the output contains lmtp.

  2. If the lmtp protocol is disabled, edit the /etc/dovecot/dovecot.conf file, and append lmtp to the values in the protocols parameter:

    protocols = ... lmtp
  3. Depending on whether you need an LMTP socket or service, make the following changes in the service lmtp section in the /etc/dovecot/conf.d/10-master.conf file:

    • LMTP socket: By default, Dovecot automatically creates the /var/run/dovecot/lmtp socket.

      Optional: Customize the ownership and permissions:

      service lmtp {
        ...
        unix_listener lmtp {
          mode = 0600
          user = postfix
          group = postfix
        }
        ...
      }
    • LMTP service: Add a inet_listener sub-section:

      service lmtp {
        ...
        inet_listener lmtp {
          port = 24
        }
        ...
      }
  4. Configure firewalld rules to allow only the SMTP server to access the LMTP port, for example:

    # firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="192.0.2.1/32" port protocol="tcp" port="24" accept"
    # firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv6" source address="2001:db8:2::1/128" port protocol="tcp" port="24" accept"
    # firewall-cmd --reload

    The subnet masks /32 for the IPv4 and /128 for the IPv6 address limit the access to the specified addresses.

  5. Reload Dovecot:

    # systemctl reload dovecot

Verification

  1. If you configured the LMTP socket, verify that Dovecot has created the socket and that the permissions are correct:

    # ls -l /var/run/dovecot/lmtp
    srw-------. 1 postfix postfix 0 Nov 22 17:17 /var/run/dovecot/lmtp
  2. Configure the SMTP server to submit emails to Dovecot using the LMTP socket or service.

    When you use the LMTP service, ensure that the SMTP server uses the LMTPS protocol or sends the STARTTLS command to use an encrypted connection.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部