In this tutorial we will cover the steps needed to install and configure Dovecot on CentOS 6.4, Debian or Ubuntu platform.


  • CentOS 6.4, Debian or Ubuntu installed on your computer/server
  • SSH access (Command line access to the server)
  • root privileges
  • Basic skills for working on a Linux environment
  • Postfix installed on the server

Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. It retrieves emails from the Postfix server and delivers them to the relevant mailbox on the server.

Install Dovecot

We will use the default package managers yum and aptitude for the Dovecot installation:

CentOS 6.4:


You will be prompted to accept the installation and additional packages might be installed as well.

Configure Dovecot

CentOS 6.4:

First we need to make some changes to the default Dovecot configuration file:

Make sure that the following lines are not commented:

After that we will edit some of the additional Dovecot configuration files stored inside the conf.d/ folder:

This will specify the way in which the email client authenticates with Dovecot.

This will specify the folder where the email messages will be stored.

After that we will edit the Postfix SMTP authentication configuration file:

Comment the following lines from the file:

and make sure that the following are uncommented:

Finally we will edit the POP3 configuration file and allow some older email clients to connect and transmit correctly:

In order for the Dovecot service to work with the Postfix service we need to add the following lines inside the Postfix configuration file:

In order for the changes to take effect restart both services:


First we will edit the Dovecot main configuration file:

and make sure that the following lines are not commented and exist:

This will set the mail protocols which will be used by Dovecot and the mailbox folder and format (Mailbox or Maildir)

In case you are using Postfix as default mail transfer agent then add the following line inside its main configuration file:

When ready we can restart the Dovecot and Postfix services:

Test the functionality of the service

If everything went well during the installation we should be able to access the Dovecot server on ports 143 (IMAP) and 110 (POP3). We can try to do that using the telnet command on the server:

The command prompt should be changed to something similar to:

Start up Dovecot automatically on server boot

In order for the Dovecot service to start automatically upon server boot up you can execute the following command:

CentOS 6.4