Introduction to Dovecot

Dovecot is an Internet Message Access Protocol (IMAP) and Post Office Protocol (POP) server, written primarily with security in mind. Dovecot aims to be lightweight, fast and easy to set up as well as highly configurable and easily extensible with plugins.



Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

Additional Downloads

Dovecot Dependencies




CLucene-, ICU-73.2, libcap-2.69 with PAM, Linux-PAM-1.5.3, Lua-5.4.6, MariaDB-10.11.5 or MySQL, OpenLDAP-2.6.6, PostgreSQL-16.0, SQLite-3.43.1, Valgrind-3.21.0, xfsprogs-6.4.0, Cassandra, lz4, stemmer and libsodium

Installation of Dovecot

There should be dedicated users and groups for unprivileged Dovecot processes and for processing users' logins. Issue the following commands as the root user:

groupadd -g 42 dovecot &&
useradd -c "Dovecot unprivileged user" -d /dev/null -u 42 \
        -g dovecot -s /bin/false dovecot &&
groupadd -g 43 dovenull &&
useradd -c "Dovecot login user" -d /dev/null -u 43 \
        -g dovenull -s /bin/false dovenull

First, apply a patch to fix problems with OpenSSL-3:

patch -Np1 -i ../dovecot-2.3.21-openssl3_fixes-1.patch

Next, apply a patch to fix a security vulnerability:

patch -Np1 -i ../dovecot-2.3.21-security_fix-1.patch

Install Dovecot by running the following commands:

CPPFLAGS="-I/usr/include/tirpc" \
LDFLAGS+=" -ltirpc" \
./configure --prefix=/usr                          \
            --sysconfdir=/etc                      \
            --localstatedir=/var                   \
            --with-systemd=no                      \
            --docdir=/usr/share/doc/dovecot-2.3.21 \
            --disable-static &&

To test the results, issue make -k check.

Now, as the root user:

make install

Command Explanations

CPPFLAGS=... LDFLAGS+=...: build with libtirpc instead of the recently removed RPC code provided by GlibC.

--disable-static: This switch prevents installation of static versions of the libraries.

--with-ldap: This switch enables OpenLDAP authentication support.

--with-pgsql: This switch enables PostgreSQL database support.

--with-mysql: This switch enables MySQL database support.

--with-sqlite: This switch enables SQLite database support.

--with-lucene: This switch enables CLucene full text search support.

--with-lua: This switch enables Lua plugin support. This includes a mail and push notification plugin.

Configuring Dovecot

Config Files

/etc/dovecot/dovecot.conf, /etc/dovecot/conf.d/*, and /etc/dovecot/local.conf

Configuration Information

Copy an example configuration, which you can use as a starting point:

cp -rv /usr/share/doc/dovecot-2.3.21/example-config/* /etc/dovecot

The following configuration is a simple proof of concept with IMAP service using local users for authentication and mailbox location. Reading files from the conf.d directory is commented out since the included example configuration requires OpenSSL and Linux PAM.

sed -i '/^\!include / s/^/#/' /etc/dovecot/dovecot.conf &&
chmod -v 1777 /var/mail &&
cat > /etc/dovecot/local.conf << "EOF"
protocols = imap
ssl = no
# The next line is only needed if you have no IPv6 network interfaces
listen = *
mail_location = mbox:~/Mail:INBOX=/var/mail/%u
userdb {
  driver = passwd
passdb {
  driver = shadow

You will definitely want to read the official documentation at if you plan to use Dovecot in a production environment.

Boot Script

If you want the Dovecot server to start automatically when the system is booted, install the /etc/rc.d/init.d/dovecot init script included in the blfs-bootscripts-20230917 package.

make install-dovecot


Installed Programs: doveadm, doveconf, dovecot, dovecot-sysreport, and dsync (symbolic link)
Installed Libraries: various internal plugins in /usr/lib/dovecot
Installed Directories: /etc/dovecot, /usr/{include,lib,libexec,share}/dovecot and /usr/share/doc/dovecot-2.3.21

Short Descriptions


is the Dovecot administration tool


is Dovecot's configuration dumping utility


is the IMAP and POP server


prints system information that is useful to the Dovecot developers when submitting bug reports upstream


is Dovecot's mailbox synchronization utility