Install Dovecot

Install Dovecot to configure POP/IMAP server.

[1] Install Dovecot.

[root@futurelinux ~]# dnf install dovecot -y

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

[root@futurelinux ~]# vi /etc/dovecot/dovecot.conf

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

[root@futurelinux ~]# 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

[root@futurelinux ~]# vi /etc/dovecot/conf.d/10-mail.conf

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

[root@futurelinux ~]# 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
}

[root@futurelinux ~]# vi /etc/dovecot/conf.d/10-ssl.conf

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

[root@futurelinux ~]# systemctl enable dovecot
[root@futurelinux ~]# systemctl start dovecot

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

[root@futurelinux ~]# vi /usr/lib/systemd/system/dovecot.service

# line 27 comment
#ProtectSystem=full

# line 29 comment
#PrivateDevices=true

[root@futurelinux ~]# systemctl daemon-reload
[root@futurelinux ~]# systemctl restart dovecot

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

[root@futurelinux ~]# firewall-cmd --permanent --add-service={pop3,imap}
success
[root@futurelinux ~]# firewall-cmd --reload
success