The model: TOML baseline, DB overrides
OxiMail does not store its whole configuration in the database. It reads a TOML file at boot as the baseline, and layers optional per-organization database overrides on top for runtime tuning without a restart. This is ADR-007. The lookup order for a setting is:- Database override (if one exists for this key) — wins.
- TOML file — the fallback, and the source of truth for everything else.
cat, versioned in
git, copied with scp, and edited over SSH. A full-database config cannot, and
it creates a chicken-and-egg problem: the database has to be configured before
you can read the configuration that configures the database. OxiMail keeps the
file as the authoritative baseline and uses the database only for runtime
overrides.
The TOML file always remains the source of truth for bootstrap and disaster
recovery. If you lose the database overrides, the server still boots from the
file. The reverse is not true.
Bootstrap vs runtime settings
Not every setting can be a database override. Anything OxiMail needs before the database is open has to come from the file. That is the chicken-and-egg rule:Never put bootstrap configuration in the database only.Bootstrap settings (TOML only) — needed before or in order to open storage and start listening:
[storage]sqlite_path,blob_path,search_path,encrypted— where and how the database itself lives.[server]bind,http_bind,admin_bind,hostname,base_url— the listening sockets and identity.[smtp]bind,submission_bind,smtps_bind,hostname— the SMTP listening sockets.[auth]default_tenant.
Hot-reload
Runtime overrides are designed to take effect without restarting the process. The mechanism isArcSwap, a lock-free atomic pointer swap
(ADR-016): the component holds an Arc to its current
state, and a reload atomically swaps in a new Arc. Readers are never blocked —
in-flight requests finish on the old value, and every subsequent read sees the
new one. This is used for the hot-reloadable components: TLS certificates (so an
ACME renewal applies without a restart), the spam blocklist, runtime config
overrides, and compiled Sieve scripts.
Because reads are never locked, hot-reload has no measurable cost on the request
path: a renewal or an override is a single pointer swap, and reloads are rare.
Setting a runtime override
Runtime overrides are stored per organization (a tenant in the storage model) and set through the admin REST API. See the Admin API for authentication (every admin endpoint requires the admin bearer token configured under[admin] token).
To set one or more overrides, PUT /admin/v1/config with a JSON body whose
overrides object maps each config key to its new value:
Listing the current overrides via
GET /admin/v1/config is not implemented in
v0.30.0 — the endpoint returns a usage hint rather than a dump. To inspect what
is in effect, check the TOML file and the overrides you have set.The config file and its shape
The server reads/etc/oximail/oximail.toml by default. CLI subcommands and the
serve command accept --config <path> to point elsewhere. The
setup wizard writes this file for you on first boot; this page is
for tuning it afterwards.
A representative annotated file looks like this. It is not exhaustive — it
shows the shape and the most common sections. See the per-feature operator pages
for the full set of keys in each area.
The real top-level sections
The sections that exist in v0.30.0 are:[server], [storage], [auth],
[mode], [smtp] (with the [[smtp.dkim_keys]] and [[smtp.transport_maps]]
arrays), [tls], [spam], [greylisting], [security], [rate_limit]
(with the [rate_limit.destination_domains] table), [logging], [admin],
[telemetry], [legacy], [mta_sts], [dns], [sieve], [network],
[distribution_groups], [scheduler], [srs], [metrics], and [push].
The per-feature pages document the keys inside each:
- Mail & SMTP —
[smtp], transport maps, DKIM keys. - Email authentication & security —
[mta_sts],[dns],[srs]. - Anti-spam —
[spam],[greylisting]. - Mailboxes & storage —
[storage]. - Encryption at rest —
[storage] encrypted. - TLS & ACME —
[tls]. - Legacy protocols —
[legacy]. - Sieve rules —
[sieve]. - Multi-tenancy —
[auth]and organization overrides.
Validating a config before you deploy
OxiMail fails loud on a bad config: rather than booting in a half-broken state, it refuses to start and prints what is wrong. You can run the same validators ahead of time without starting the server:dane_enabled
set with no DNS provider, and deprecated pre-v0.30 DKIM keys still in the file.
See the CLI reference for the full command set and
Operations for the day-to-day workflow.
Next steps
- First boot & setup wizard — what the wizard writes into this file.
- Admin API — the endpoint that sets runtime overrides.
- Operations — logs, backups, and upgrades.
- CLI reference — every
oximailsubcommand.