Dovecot configuration

Dovecot is an open-source IMAP and POP3 server for Linux/UNIX-like systems.

This page refers mainly to the RHEL/CentOS installation of Dovecot, versions are:

  • RHEL7/CentOS7: version 2.2.10.

  • Fedora 22: version 2.2.18.

Dovecot configuration

The Dovecot IMAP and POP3 mailbox service is configured by the files:


Documentation is in /usr/share/doc/dovecot*/ and on the Dovecot homepage.


By default Dovecot only permits user UIDs >500 to log in. To change this default configure, for example:

first_valid_uid = 1000

Dovecot and SSL certificates

Dovecot configuration of SSL is documented in

The IMAPS service (IMAP over SSL) is configured in /etc/dovecot/conf.d/10-ssl.conf.

The SSL certificates for are stored in /etc/pki/tls/ subdirectories.

Some SSL certificates require the use of a Certificate Authority (CA) file. This should be configured as:

# File containing trusted SSL certificate authorities. Usually not needed.
# The CAfile should contain the CA-certificate(s) followed by the matching
# CRL(s). CRL checking is new in dovecot .rc1
ssl_ca_file = /etc/pki/tls/certs/intermediate.crt

Dovecot and SSL protocols/ciphers

For reason of security one should never use low-strength SSL-certificates. This is configured as explained in by:

# SSL ciphers to use
ssl_parameters_regenerate = 72h
# The !TLSv1 disables TLSv1.0. Only TLS v1.1 and v1.2 are OK
ssl_protocols = !SSLv2 !SSLv3 !TLSv1
# Prefer the server's order of ciphers over client's
# Only available on dovecot 2.2.6 and later::
ssl_prefer_server_ciphers = yes
# Only available on dovecot 2.2.7 and later::
ssl_dh_parameters_length = 2048

Notice that we disable this CBC cipher, in contrast to advice in Guide to Deploying Diffie-Hellman for TLS:


Testing dovecot SSL

Check the Dovecot SSL configurations by:

grep  ^ssl_ /etc/dovecot/conf.d/10-ssl.conf

From a client machine, test the Dovecot SSL server as explained in (section Testing):

openssl s_client -connect servername:imaps -ssl2   # Should be rejected
openssl s_client -connect servername:imaps -ssl3   # Should be rejected
openssl s_client -connect servername:imaps -tls1   # Should be rejected
openssl s_client -connect servername:imaps -tls1_1
openssl s_client -connect servername:imaps -tls1_2

See man s_client for documentation.

From the output of this command you can put Server certificate into a file and display the server certificate by:

openssl x509 -noout -text -in <certificate-file>

IMAP quotas

Dovecot from version 1.0 supports the usage of IMAP disk quotas, see Configuration of filesystem quotas is described in

The Thunderbird mail client does support IMAP quotas (right-click on an IMAP folder, select Properties and view the Quota tab).


By default Dovecot logs every user connection, which causes excessive amounts of logging in the syslog. To turn off this logging configure conf.d/10-logging.conf:

info_log_path = /dev/null

See about logging.