This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.

Quick Configuration

If you just want to get Dovecot running with typical configuration in a typical environment, here's what you'll have to do:

TLDR; Just want it running

Here is a very simple basic configuration with single vmail user to be placed as dovecot.conf. Please note that some distros split configuration under /etc/dovecot/conf.d, which, while it can be useful, is not required.

You need to create group vmail and user vmail.

## this is sometimes needed
#first_valid_uid = uid-of-vmail-user

# if you want to use system users
passdb {
  driver = pam

userdb {
  driver = passwd
  args = blocking=no
  override_fields = uid=vmail gid=vmail

# if you are using v2.3+

Configuration file

Prebuilt packages usually install the configuration files into /etc/dovecot/. You'll find the correct path by running:

doveconf -n | head -n 1

It's a good idea to read through all the config files and see what settings you might want to change.

Installing from sources

If you compiled and installed Dovecot from sources, Dovecot has installed only a /usr/local/etc/dovecot/README file, which contains the path to the installed example configuration files, usually /usr/local/share/doc/dovecot/example-config. Copy them to etc/:

cp -r /usr/local/share/doc/dovecot/example-config/* /usr/local/etc/dovecot/

Split configuration files

The default configuration starts from dovecot.conf, which contains an !include conf.d/*.conf statement to read the rest of the configuration. The idea is that the settings are nicely grouped into different files to make it easier for new admins to scan through related settings. It doesn't matter which config file you add which setting. In the production system it's often easier to just have a single dovecot.conf file, which you can create easily using

doveconf -n > dovecot.conf

Hints about writing configuration files

ssl_cert = </etc/ssl/certs/imap.pem


You'll probably be using PAM authentication. See the PAM page for how to configure it. A typical configuration with Linux would be to create /etc/pam.d/dovecot which contains:

auth    required
account required

If you're using something else, see password databases and user databases.

Mail Location

You can let Dovecot do its automatic mail location detection, but if that doesn't work, you can set the location manually in mail_location setting. See MailLocation for more information.


Make sure that all software accessing the mboxes are using the same locking methods in the same order. The order is important to prevent deadlocking. From Dovecot's side you can change these from mbox_read_locks and mbox_write_locks settings. See MboxLocking for more information.

If you're using /var/mail/ directory for INBOXes, you may need to set mail_privileged_group = mail so Dovecot can create dotlocks there.

For better performance you may want to set mbox_very_dirty_syncs = yes option.


For better performance you may want to set maildir_very_dirty_syncs = yes option.

Client Workarounds

Check imap_client_workarounds and pop3_client_workarounds and see if you want to enable more of them than the defaults.

SSL and Plaintext Authentication

If you intend to use SSL, set ssl_cert and ssl_key settings. Otherwise set ssl = no. Easiest way to get SSL certificates built is to use Dovecot's doc/ script. See SSL.

By default disable_plaintext_auth = yes, which means that Dovecot will fail the authentication if the client doesn't use SSL (or use non-plaintext authentication). This is recommended in most situations, since it prevents leaking passwords. However, if you don't offer SSL for some reason, you'll probably want to set disable_plaintext_auth = no.


If you're using NFS or some other remote filesystem that's shared between multiple computers, you should read NFS.


See RunningDovecot and Logging.

QuickConfiguration (last edited 2018-05-20 21:07:51 by 89-27-3-130)