1 1aed0ca2 2022-02-26 o First, run install.sh as a privileged user (root).
3 1aed0ca2 2022-02-26 o doas sh install.sh
5 1aed0ca2 2022-02-26 o It is safe to run more than once.
6 1aed0ca2 2022-02-26 o install.sh does the following:
8 1aed0ca2 2022-02-26 o - installs packages
9 1aed0ca2 2022-02-26 o - enables daemons
10 1aed0ca2 2022-02-26 o - creates directories
11 1aed0ca2 2022-02-26 o - creates an unprivileged mail delivery system user
12 1aed0ca2 2022-02-26 o - installs configuration files
13 1aed0ca2 2022-02-26 o - initialises the accounts database if not present already
14 1aed0ca2 2022-02-26 o - restarts daemons
16 1aed0ca2 2022-02-26 o Extra steps that need to be run manually follow.
18 1aed0ca2 2022-02-26 o TLS certificate
21 1aed0ca2 2022-02-26 o Renew the certificate every night with an entry in root's crontab:
23 1aed0ca2 2022-02-26 o 0 4 * * * acme-client mail.srcbeat.com && rcctl restart smtpd dovecot
25 1aed0ca2 2022-02-26 o The required httpd and acme-client configuration are installed by install.sh.
30 1aed0ca2 2022-02-26 o Add the user and password database configuration to /etc/dovecot/conf.d/10-auth.conf:
33 1aed0ca2 2022-02-26 o driver = static
34 1aed0ca2 2022-02-26 o args = uid=vmail gid=vmail home=/mail/box/%d/%n
38 1aed0ca2 2022-02-26 o args = /etc/dovecot/dovecot-sql.conf.ext
41 1aed0ca2 2022-02-26 o dovecot-sql.conf.ext is already installed by install.sh.
43 1aed0ca2 2022-02-26 o Add the mail location to /etc/dovecot/conf.d/10-mail.conf:
45 1aed0ca2 2022-02-26 o mail_location = maildir:/mail/box/%d/%n/Maildir:LAYOUT=fs
47 1aed0ca2 2022-02-26 o With this configuration mail for the account with the username "test@example.com"
48 1aed0ca2 2022-02-26 o is stored at /mail/box/example.com/test/Maildir.
50 1aed0ca2 2022-02-26 o Configure dovecot to load the TLS keys by adding the following to /etc/dovecot/conf.d/10-ssl.conf:
53 1aed0ca2 2022-02-26 o ssl_cert = </etc/ssl/mail.srcbeat.com.crt
54 1aed0ca2 2022-02-26 o ssl_key = </etc/ssl/private/mail.srcbeat.com.key