Gernot Walzl


Dovecot is a mail delivery agent (MDA).

This tutorial shows how to configure Dovecot
so that mail clients can access their mails over IMAP.


Packages for Dovecot are found in the official Debian repository:
apt-get install dovecot-imapd


The login over IMAP needs to be enabled in the file

service imap-login {
  inet_listener imap {
    #port = 143
  inet_listener imaps {
    port = 993
    ssl = yes


The maildir format is often used to store mails.
The location and the format of the mails is configured in

mail_location = maildir:~/Maildir

SSL/TLS encryption is highly recommended when login credentials are transmitted
over the internet. The SSL/TLS certificates are configures in

ssl_cert = </etc/letsencrypt/live/
ssl_key = </etc/letsencrypt/live/


The default configuration uses system accounts for authentication.
To use a text file of user accounts for authentication,
change the configuration in

#!include auth-system.conf.ext
!include auth-passwdfile.conf.ext

The file format for user accounts is essentially the same as for /etc/passwd.
Fields in braces are not used by Dovecot.


To crypt a password, use the command line tool mkpasswd.
It is part of the whois package.

Only Dovecot should be able to access the list of user accounts:
chown root:dovecot /etc/dovecot/users
chmod 640 /etc/dovecot/users

External Links

CONTENT.html 2020-05-06 2.4 KB