Skip to content

Instance security settings ​

Two security settings are set without ever touching the database: from the administration area, or with an operations command. Both go through the same service, with the same checks and the same audit line; the command records the system actor and via: "cli".

The commands run with the instance's image, configuration and database, in a throwaway container — never through docker exec in the server container. They do not start the application: a database connection is enough. They write one JSON line to standard output; exit codes: 0 done, 2 invalid arguments, 3 refused (unknown mailbox, no Microsoft application…), 1 error.

bash
# Self-hosting
docker compose run --rm -T app node dist/cli.js mailboxes:mode --address sales@customer.example --mode processing_only --dry-run
# Hosted instance (operations repository)
infra/cell/bin/instance-cli SLUG -- mailboxes:mode --address sales@customer.example --mode processing_only

A mailbox's mode: mailboxes:mode ​

bash
node dist/cli.js mailboxes:mode (--address ADDRESS | --id UUID) --mode full|processing_only [--dry-run]
ModeEffect
full (default)The content of new messages is kept: body, attachments, search text.
processing_onlyProcessing only: each new message is processed by the workflows, then neither its body, nor its attachments, nor its search text are kept. Metadata (sender, recipients, subject, dates, folders) and a 200-character preview remain.
  • The change applies to messages received afterwards. Content already kept stays until the mailbox is deleted.
  • --address targets every mailbox with that address; --id, a single one. Only one of the two.
  • --dry-run says what would change without writing anything. Replayable: a mailbox already in the requested mode does not move and is not audited again.
  • The output restates the effect of the mode (effect) and lists the mailboxes, with changed.
  • Audit: mailbox.sync_mode_changed (address, from, to, via).

In the interface: Administration › Shared mailboxes, Mailbox mode column; the confirmation dialog says what will no longer be kept. See also Mailboxes and mirror.

The allowed Microsoft tenant: oauth:tenant ​

bash
node dist/cli.js oauth:tenant --tenant GUID [--dry-run]   # pin
node dist/cli.js oauth:tenant --clear [--dry-run]         # accept all tenants
node dist/cli.js oauth:tenant --show                      # read the setting

The Microsoft application is multitenant: by default any Microsoft work account can connect to it. Pinning the organisation's tenant (its Tenant ID, a GUID, Overview page of the Entra portal) has two effects:

  1. the sign-in address becomes the tenant's (https://login.microsoftonline.com/<GUID>/v2.0): Microsoft only offers accounts of that tenant;
  2. each connection is also compared to the token's tenant (tid): an account of another organisation is refused with oauth.tenant_not_allowed, and nothing is stored.
  • Only a GUID is accepted — never a domain or a URL: the address is built by Loop & Roll. Refusal: exit code 2 (argument) or oauth.invalid_tenant_id.
  • The Microsoft application must be registered (otherwise oauth.app_not_configured, exit code 3).
  • The setting survives replacing the client id or secret.
  • Existing connections are not cut; a connection from another tenant will be refused at its next authorisation.
  • Audit: oauth_app.tenant_pinned (from, to, via).

In the interface: Administration › OAuth applications › Microsoft, section Restrict to your Microsoft 365 tenant. See also Microsoft.

Loop & Roll — the workflow builder for email.