Installation | Topics | Beyond Lino

Dovecot

Dovecot is an IMAP/POP3 server, which is needed if users of your server want to access their mails using a mail client like Thunderbird.

Before installing Dovecot, you should have installed Postfix.

Using hints from:

Installation

Install the Debian packages:

$ sudo apt install dovecot-imapd dovecot-pop3d

Edit one line in your /etc/dovecot/dovecot.conf file:

listen = *, ::

Edit your /etc/dovecot/conf.d/10-auth.conf file:

disable_plaintext_auth = no  # only needed before trixie
auth_mechanisms = plain login

Edit your /etc/dovecot/conf.d/10-mail.conf file, deactivate the follwing lines:

#mail_driver = mbox
#mail_home = /home/%{user | username}
#mail_path = %{home}/mail
#mail_inbox_path = /var/mail/%{user}

and activate the folloiwing ones:

mail_driver = maildir
mail_path = ~/Maildir
mail_inbox_path = ~/Maildir/.INBOX

IMPORTANT: Mail location parameters should be in sync. Above means that the postfix config parameter is home_mailbox = Maildir/.

Edit your /etc/dovecot/conf.d/10-master.conf file:

unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    # before trixie: user = postfix
    # before trixie: group = postfix
  }

Edit your /etc/dovecot/conf.d/10-ssl.conf file:

# before trixie:   ssl = yes
# before trixie: ssl_cert = </etc/letsencrypt/live/mail.example.com/fullchain.pem
# before trixie: ssl_key = </etc/letsencrypt/live/mail.example.com/privkey.pem
ssl_server_cert_file = /etc/letsencrypt/live/mail.example.com/fullchain.pem
ssl_server_key_file = /etc/letsencrypt/live/mail.example.com/privkey.pem

Control the dovecot service:

$ sudo systemctl enable dovecot.service
$ sudo systemctl stop dovecot.service
$ sudo systemctl start dovecot.service
$ sudo systemctl status dovecot.service