1.7. Disabling the IMAP or POP3 service in Dovecot


By default, Dovecot provides IMAP and POP3 services. If you require only one of them, you can disable the other to reduce the surface for attack.

Prerequisites

  • Dovecot is installed.

Procedure

  1. Uncomment the protocols parameter in the /etc/dovecot/dovecot.conf file, and set it to use the required protocols. For example, if you do not require POP3, set:

    protocols = imap lmtp

    By default, the imap, pop3, and lmtp protocols are enabled.

  2. Reload Dovecot:

    # systemctl reload dovecot
  3. Close the ports that are no longer required in the local firewall. For example, to close the ports for the POP3S and POP3 protocols, enter:

    # firewall-cmd --remove-service=pop3s --remove-service=pop3
    # firewall-cmd --reload

Verification

  • Display all ports in LISTEN mode opened by the dovecot process:

    # ss -tulp | grep dovecot
    tcp  LISTEN 0  100  0.0.0.0:993  0.0.0.0:*  users:(("dovecot",pid=1405,fd=44))
    tcp  LISTEN 0  100  0.0.0.0:143  0.0.0.0:*  users:(("dovecot",pid=1405,fd=42))
    tcp  LISTEN 0  100     [::]:993     [::]:*  users:(("dovecot",pid=1405,fd=45))
    tcp  LISTEN 0  100     [::]:143     [::]:*  users:(("dovecot",pid=1405,fd=43))

    In this example, Dovecot listens only on the TCP ports 993 (IMAPS) and 143 (IMAP).

    Note that Dovecot only opens a port for the LMTP protocol if you configure the service to listen on a port instead of using a socket.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部