Install Dovecot

Install Dovecot to configure POP/IMAP server.

[1] Install Dovecot.

[[email protected] ~]# dnf install dovecot -y

[2] This example shows to configure to provide SASL function to Postfix.

[[email protected] ~]# vi /etc/dovecot/dovecot.conf

# line 30: uncomment (if not use IPv6, remove [::])
listen = *, ::

[[email protected] ~]# vi /etc/dovecot/conf.d/10-auth.conf

# line 10: uncomment and change (allow plain text auth)
disable_plaintext_auth = no

# line 100: add
auth_mechanisms = plain login

[[email protected] ~]# vi /etc/dovecot/conf.d/10-mail.conf

# line 30: uncomment and add
mail_location = maildir:~/Maildir

[[email protected] ~]# vi /etc/dovecot/conf.d/10-master.conf

# line 107-111: uncomment and add like follows
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix
}

[[email protected] ~]# vi /etc/dovecot/conf.d/10-ssl.conf

# line 8: change (not require SSL)
ssl = no

[[email protected] ~]# systemctl enable dovecot
[[email protected] ~]# systemctl start dovecot

[3] On systems with SELinux active, the service may give NAMESPACE error. To fix this:

[[email protected] ~]# vi /usr/lib/systemd/system/dovecot.service

# line 27 comment
#ProtectSystem=full

# line 29 comment
#PrivateDevices=true

[[email protected] ~]# systemctl daemon-reload
[[email protected] ~]# systemctl restart dovecot

[4] If Firewalld is running, allow POP/IMAP service. POP uses 110/TCP, IMAP uses 143/TCP.

[[email protected] ~]# firewall-cmd --permanent --add-service={pop3,imap}
success
[[email protected] ~]# firewall-cmd --reload
success