Step 1 – Install Dovecot on CentOS 8

Dovecot package is available under the AppStream yum repository. You just need to install package using the yum/dnf package manager on CentOS 8 system.

Step 2 – Configure Dovecot

Once the installation finished, configure Dovecot server as per your requirements. Here is the quick and useful configuration of Dovecot to work on your system.

Edit Dovecot main configuration file and un-comment below lines to enable POP3 and IMAP protocols. Also configure Dovecot on all interfaces.sudo vi /etc/dovecot/dovecot.conf protocols = imap pop3 lmtp listen = *, :: Then edit the authentication file for Dovecot and update following values.sudo vi /etc/dovecot/conf.d/10-auth.conf disable_plaintext_auth = no auth_mechanisms = plain login After that, edit mail configuration file to configure location of the Mailbox. Make sure to set this to correct location where your email server is configure to save users emails.sudo vi /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:~/Maildir Next, edit below configuration file and set the username and group name of the mail server is running with.sudo vi /etc/dovecot/conf.d/10-master.conf unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix } Finally edit Dovecot SSL configuration file. Set SSL to yes or required. By default it uses self singed certificate, if you have your own certificates update them as followings.sudo vi /etc/dovecot/conf.d/10-ssl.conf ssl = yes ssl_cert =

Step 3 - Manage Dovecot Service

We can manage dovecot using systemctl command line tool. Use the following command to enable Dovecot service. Use the following commands to start/stop or restart Dovecot service: Use the below command to view the current status of the service

Step 4 - Test Configuration

An username “rahul” is created on my CentOS 8 system. We need mutt command line utility to connect mailbox using imaps protocol. Then connect to mailbox using below command: This will prompt to accept certificate (Press a for accept alwys). After that it will prompt for the password. Enter user password and press enter. You will see the emails of your account.

Step 5 - Adjust Rules in FirewallD

To access your mail server from another computer, you must adjust the firewall rules to allow connections to the server on the necessary ports. The default POP/IMAP ports are:

IMAP - 143 IMAPS - 993 POP3 - 110 POP3S - 995

Run the below commands to add firewall rules: Then reload the changes.

Conclusion

Dovecot service has been configured on your system. You have configured your server to access user mailbox via POP3 or IMAP protocols.

How to Install Dovecot on CentOS 8   TecAdmin - 62