Dovecot

-------

#  dnf -y install dovecot*

 

cp /etc/dovecot/dovecot.conf    /etc/dovecot/dovecot.conf.ORG

cp /etc/dovecot/conf.d/10-auth.conf   /etc/dovecot/conf.d/10-auth.conf.ORG

cp /etc/dovecot/conf.d/10-mail.conf  /etc/dovecot/conf.d/10-mail.conf.ORG

cp /etc/dovecot/conf.d/10-master.conf   /etc/dovecot/conf.d/10-master.conf.ORG

cp /etc/dovecot/conf.d/10-ssl.conf   /etc/dovecot/conf.d/10-ssl.conf.ORG

 

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

protocols = imap pop3 lmtp

# line 30: listen = *, ::

listen = *             #  (*) here as your value, which is a wildcard meaning all IPv4 addresses

  OR

listen = *, ::           # For IPv6 addresses, you would use a double colon (::)

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

# line 10:   

disable_plaintext_auth = no

# line 100: add

auth_mechanisms = plain login

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

# line 30:

mail_location = maildir:~/Maildir

[root@mail ~]#   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@mail ~]#   vi /etc/dovecot/conf.d/10-ssl.conf

# line 8: change (not require SSL)

ssl = yes

[root@mail ~]# systemctl enable --now dovecot

                        systemctl restart dovecot

      XXXXXXXXXXXXXXXXXXXXXXXXX---------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx

Dovecot on CentOS 8

sudo dnf -y install dovecot

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.

Step 3 - Manage Dovecot Service

We can manage dovecot using systemctl command line tool. Use the following command to enable Dovecot service.

sudo systemctl enable dovecot.service

Use the following commands to start/stop or restart Dovecot service:

sudo systemctl start dovecot.service sudo systemctl stop dovecot.service sudo systemctl restart dovecot.service

Use the below command to view the current status of the service

sudo systemctl status dovecot.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.

sudo dnf install mutt

Then connect to mailbox using below command:

mutt -f imaps://rahul@localhost

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:

Run the below commands to add firewall rules:

sudo firewall-cmd --add-service={pop3,imap} --permanent sudo firewall-cmd --add-service={pop3s,imaps} --permanent

Then reload the changes.

sudo firewall-cmd --reload

-----