Raven

Raven — Whitelabel Email Platform Engine

  • *rea:*Workspace
  • *ath:*platform/raven (engine), platform/kmail (flagship webmail)
  • *ind:*Multi-tenant email platform — domain provisioning, mailbox management, routing

Role in the stack

Raven is the B2B email infrastructure engine for the Koder Stack. It provides multi-tenant domain provisioning, mailbox management, SMTPJMAP routing, and administration APIs — all backed by [Stalwart](https:stalw.art) as the underlying MTA. The flagship product *mail*(`platformkmail`) is the consumer webmail client that runs on top of Raven.

Kmail (product) → Raven (engine) → Stalwart (MTA)

Any whitelabel deployment that wants to offer email to its customers licenses Raven directly; they build their own frontend on top without Kmail branding.

Primary couplings

Consumer Relationship
platform/kmail Flagship webmail product running on Raven
platform/postal Transactional email delivery layer
platform/id OIDC authentication for mailbox access
Stalwart MTA Physical mail server (SMTP, JMAP, IMAP)

Gmail Bridge (Domain-Wide Delegation)

Raven ships a builtin Gmail Bridge connector (internal/gmailbridge) that lets corporate tenants mirror or send mail through Gmail using a Google Workspace service account with DomainWide Delegation. The bridge:

  • Mints RS256 DWD access tokens from a service account JSON key (stdlib only, no external JWT lib)
  • Caches tokens per impersonated user with a 55-minute TTL
  • Exposes REST endpoints under /v1/tenants/{tenantId}/connectors/gmail/ for configure, remove, list messages, get message, send, and modify labels
  • Retries on HTTP 429 with exponential backoff (base 500 ms, up to 5 attempts)

Status

Functional — Gmail Bridge complete (ticket RAVEN-005). Core domain/mailbox APIs powered by Stalwart.

Configuration

On production (s.k.lin): see reference_koder_mail_server_config.md in global memory for Stalwart role permissions and Raven service config.

Source: ../home/koder/dev/koder/meta/docs/stack/modules/raven.md