Dovecot-2.4.4

#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-1090

### Chapter 21. Mail Server Software

- Prev

  Mail Server Software

- Next

  Exim-4.99.4

- Up
- Home

# Dovecot-2.4.4

## 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.

### Note

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

- Download (HTTP): https://www.dovecot.org/releases/2.4/dovecot-2.4.4.tar.gz

- Download MD5 sum: 1cfdb796f726dff687b6431a3b6012c3

- Download size: 7.9 MB

- Estimated disk space required: 253 MB

- Estimated build time: 4.8 SBU

### Dovecot Dependencies

#### Required

libtirpc-1.3.7 and Linux-PAM-1.7.2

#### Optional

Cyrus SASL-2.1.28, ICU-78.3, libcap-2.78 with PAM, libunwind-1.8.3, Lua-5.4.8, MariaDB-12.3.2 or MySQL, OpenLDAP-2.6.13, PostgreSQL-18.4, Valgrind-3.27.1, xapian-2.0.0, xfsprogs-7.1.1, Cassandra, stemmer and libsodium

## Installation of Dovecot

### Warning

There are significant changes in the configuration of this package that are required when updating to Dovecot 2.4.0. Please review the documentation at Dovecot Upgrade Guide before continuing if you are upgrading this package from a previous version.

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

Install Dovecot by running the following commands:

    ./configure --prefix=/usr                          \
                --sysconfdir=/etc                      \
                --localstatedir=/var                   \
                --with-systemd=no                      \
                --docdir=/usr/share/doc/dovecot-2.4.4  \
                --disable-static                       \
                CXX="g++ -std=gnu++17" &&
    make

To test the results, issue make -k check.

Now, as the `root` user:

    make install

## Command Explanations

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

`CXX="g++ -std=gnu++17"`: This setting enables the C++17 standard. It is needed if xapian-2.0.0 is installed, and does not hurt if not.

`--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-lua=no`: This switch enables Lua plugin support. This includes a mail and push notification plugin.

## Configuring Dovecot

### Config Files

`/etc/dovecot/dovecot.conf`

### Configuration Information

The following configuration is a simple proof of concept with IMAP service using local users for authentication and mailbox location.

    mv -v /etc/dovecot/dovecot.conf{,.orig} &&
    chmod -v 1777 /var/mail &&
    cat > /etc/dovecot/dovecot.conf << "EOF"

    # The dovecot configuration requires a minimum version to be set. The server
    # will refuse to start if the version set here is older than the version of
    # Dovecot installed. This option allows the Dovecot server to set reasonable
    # default values based on what version is set here.
    dovecot_config_version = 2.4.4

    # This option sets the minimum version that is able to read data files from
    # the Dovecot server. This is primarily for a cluster which may have several
    # different versions of Dovecot installed, but is required for the server to
    # run.
    dovecot_storage_version = 2.4.4

    protocols = imap
    ssl = no
    # The next line is only needed if you have no IPv6 network interfaces
    listen = *
    mail_inbox_path = /var/mail/%{user}
    mail_driver = mbox
    mail_path = ~/Mail
    userdb users {
      driver = passwd
    }
    passdb passwords {
      driver = pam
    }
    EOF

The above configuration also requires a configuration file to be installed for Linux-PAM so dovecot can authenticate users. Issue the following command as the `root` user to create the configuration file for Linux-PAM:

    cat > /etc/pam.d/dovecot << "EOF"
    # Begin /etc/pam.d/dovecot

    auth     include system-auth
    account  include system-account
    password include system-password

    # End /etc/pam.d/dovecot
    EOF

You will definitely want to read the official documentation at https://doc.dovecot.org/2.4.4/ 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-20251220 package.

    make install-dovecot

## Contents

Installed Programs: doveadm, doveconf, dovecot, and dovecot-sysreport
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.4.4

### Short Descriptions

doveadm | is the Dovecot administration tool
doveconf | is Dovecot's configuration dumping utility
dovecot | is the IMAP and POP server
dovecot-sysreport | prints system information that is useful to the Dovecot developers when submitting bug reports upstream

- Prev

  Mail Server Software

- Next

  Exim-4.99.4

- Up
- Home