How to Configure Dovecot IMAP/POP3 Server on Ubuntu

Dovecot is an open-source e mail server with native assist for the IMAP and POP3 protocols. In addition to Dovecot’s built-in performance, it’s extensible by way of quite a few plugins.

This article explains how to set up and configure a Dovecot server and the way to deploy a Dovecot plugin.

How To Install Dovecot on Ubuntu 20.04

Installing Dovecot onto Ubuntu is a straightforward course of. In truth, the preliminary set up could be accomplished utilizing a single command:

Sudo apt set up dovecot-imapd dovecot-pop3d

This command installs Dovecot with the POP3 and IMAP protocols, that are widespread to all mail servers. Figure 1 exhibits what the console display seems to be like on the completion of the set up course of.

Brien Posey

Figure 1. The Dovecot deployment course of has been accomplished.

How to Configure Dovecot for IMAP/POP3 Access on Ubuntu

The Dovecot set up course of robotically implements a default configuration that’s sufficient for getting the mail server up and working. However, there are a number of totally different configuration information that you would be able to edit to finetune the Dovecot configuration.

Dovecot shops its configuration settings in a sequence of configuration information, every of which use a .conf extension and are saved within the /and many others/dovecot/conf.d folder. You can edit these information through the use of the Nano editor.

Suppose, for instance, that you really want to arrange the mailbox listing. To achieve this, you’d use the Nano editor to open a configuration file named 10-mail.conf, then set the mail  location worth throughout the configuration file.

Here is the command:

Sudo nano /and many others/dovecot/conf.d/10-mail.conf

You can see what the Nano editor seems to be like in Figure 2. If your purpose is to set a mailbox location, you need to modify the mail_location line. (It’s the road that’s displayed in white textual content. All the blue textual content proven within the determine exists solely for documentation functions.)

The mail_location will retailer your customers’ e mail messages, so it is vital to select a safe location with loads of free house. Many organizations set the mail_location to Maildir. To achieve this, you’d change the mail_location line to:


When you might have completed making any required adjustments to the file, it can save you the file by urgent Ctrl+O.

Brien PoseyScreenshot of Nano editor

Figure 2. This is the way you edit the 10-mail.conf file utilizing the Nano editor.

Once the mail location has been configured, it’s a good suggestion to try a few of the accessible safety settings. For instance, it is best to take into account whether or not you need to permit plain textual content authentication. While disabling plain textual content authentication could make your mail server safer, some mail shoppers require plain textual content authentication to be enabled.

You can discover the settings associated to plain textual content authentication within the 10-auth.conf file. This file comprises a line (which is commented out by default) that reads:


You can allow plain textual content authentication by setting this line to No, however it is best to solely achieve this if SSL is enabled.

You can entry the server’s SSL configuration within the 10-ssl.conf file. The use of SSL is enabled by default by way of a line that merely says ssl=sure. Initially, SSL is configured to use a self-signed certificate, however it is best to ideally present your personal certificates. You can do that by finding the ssl_cert= line, then changing the default worth of /dovecot/non-public/dovecot.pem> with the identify and placement of your certificates’s PEM file. There can also be an ssl_key= setting throughout the configuration file that you need to use to present your personal SSL key.

How To Install Optional Modules

As beforehand famous, Dovecot is extensible by way of modules. You can set up a module through the use of the sudo apt set up command, adopted by the identify of the module you would like to set up.

For instance, if you would like to set up the Dovecot antispam module, you’d use this command:

Sudo apt set up dovecot-antispam

Figure 3 exhibits what the antispam module set up course of seems to be like.

Dovecot 3.jpg

Figure 3. This is how you put in the Dovecot antispam module.

You will discover that this command resembles the command that was initially used to set up Dovecot, however as an alternative of putting in dovecot-pop3d and dovecot-imapd, we’re putting in dovecot-antispam. The same syntax is used to set up different modules.

Dovecot is straightforward to set up and configure. If you want further assist, learn the remark portion of the Dovecot configuration information, as this portion comprises detailed info associated to configuring Dovecot.

Related Posts