Blame


1 1aed0ca2 2022-02-26 o First, run install.sh as a privileged user (root).
2 1aed0ca2 2022-02-26 o
3 1aed0ca2 2022-02-26 o doas sh install.sh
4 1aed0ca2 2022-02-26 o
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:
7 1aed0ca2 2022-02-26 o
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
15 1aed0ca2 2022-02-26 o
16 1aed0ca2 2022-02-26 o Extra steps that need to be run manually follow.
17 1aed0ca2 2022-02-26 o
18 1aed0ca2 2022-02-26 o TLS certificate
19 1aed0ca2 2022-02-26 o ------
20 1aed0ca2 2022-02-26 o
21 1aed0ca2 2022-02-26 o Renew the certificate every night with an entry in root's crontab:
22 1aed0ca2 2022-02-26 o
23 1aed0ca2 2022-02-26 o 0 4 * * * acme-client mail.srcbeat.com && rcctl restart smtpd dovecot
24 1aed0ca2 2022-02-26 o
25 1aed0ca2 2022-02-26 o The required httpd and acme-client configuration are installed by install.sh.
26 1aed0ca2 2022-02-26 o
27 1aed0ca2 2022-02-26 o Dovecot
28 1aed0ca2 2022-02-26 o ------
29 1aed0ca2 2022-02-26 o
30 1aed0ca2 2022-02-26 o Add the user and password database configuration to /etc/dovecot/conf.d/10-auth.conf:
31 1aed0ca2 2022-02-26 o
32 1aed0ca2 2022-02-26 o userdb {
33 1aed0ca2 2022-02-26 o driver = static
34 1aed0ca2 2022-02-26 o args = uid=vmail gid=vmail home=/mail/box/%d/%n
35 1aed0ca2 2022-02-26 o }
36 1aed0ca2 2022-02-26 o passdb {
37 1aed0ca2 2022-02-26 o driver = sql
38 1aed0ca2 2022-02-26 o args = /etc/dovecot/dovecot-sql.conf.ext
39 1aed0ca2 2022-02-26 o }
40 1aed0ca2 2022-02-26 o
41 1aed0ca2 2022-02-26 o dovecot-sql.conf.ext is already installed by install.sh.
42 1aed0ca2 2022-02-26 o
43 1aed0ca2 2022-02-26 o Add the mail location to /etc/dovecot/conf.d/10-mail.conf:
44 1aed0ca2 2022-02-26 o
45 1aed0ca2 2022-02-26 o mail_location = maildir:/mail/box/%d/%n/Maildir:LAYOUT=fs
46 1aed0ca2 2022-02-26 o
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.
49 1aed0ca2 2022-02-26 o
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:
51 1aed0ca2 2022-02-26 o
52 1aed0ca2 2022-02-26 o ssl = required
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