Blob


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