+-----------------------------------------------------------------------
| Running stalwart-mail on OpenBSD
+-----------------------------------------------------------------------

First run
=========

The complete documentation is at https://stalw.art/docs/get-started

With no config.json present at the supplied config file path, Stalwart will
start in bootstrap mode. This means it will be only listening on port 8080 for
the web UI and the JMAP API (accessible with, for instance, stalwart-cli). A
temporary admin password will be generated and written in the output, so execute
the daemon in the foreground like so:

# su -fl -c stalwart_mail -s /bin/sh root -c 'stalwart --config /etc/stalwart/config.json'

The web admin interface uses WebAssembly which is switched off by default on
Chromium-based browsers. Set ENABLE_WASM=1 in the environment to enable it.
You will also likely want to install the stalwart-cli package to manage the
server on the command line.

During bootstrap mode, Stalwart will:
- download the web admin interface from https://github.com/stalwartlabs/webadmin/releases/latest/download/webadmin.zip
- write the config file to point to a default datastore configuration

Stalwart can also read from several environment variables, which can be added to
the login.conf(5) drop-in as appropriate for your installation:
- override the hostname used in HTTP responses:
  STALWART_HOSTNAME=mail.example.com

- override the HTTPS port used in HTTPS responses: STALWART_HTTPS_PORT=8080

- enable recovery mode: STALWART_RECOVERY_MODE=true

- log level while in recovery mode (default: info):
  STALWART_RECOVERY_MODE_LOG_LEVEL=debug

- HTTP port used in recovery mode (default: 8080):
  STALWART_RECOVERY_MODE_PORT=9090

- fixed administrator credentials (default: a temporary random password is
  generated and printed to the logs): STALWART_RECOVERY_ADMIN=admin:changeme
  NB: make sure to escape the colon with \c if putting this in login.conf,
  consult cgetent(3) for more information.

- cluster role assigned to this node. Must match a role name defined in the
  cluster registry. Leave unset for a standalone (non-clustered) deployment:
  STALWART_ROLE=primary

- push-notification shard this node is responsible for, when running in a
  cluster: STALWART_PUSH_SHARD=1

Upgrading
=========

Please refer to UPGRADING_v0_16.md in /usr/local/share/doc/stalwart-mail/ as v0.16
introduced a lot of fundamental breaking changes.
