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

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동