Octa Engineering Notes Christian Elías Request for Comments: OCTA-25 octa.page Category: Informational December 2026 Owlery: a shared outbound mail relay Abstract Design of an internal relay that centralizes transactional email behind per-application keys and a retry queue Status of This Memo This memo documents notes notes for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited. The canonical version lives at https://octa.page/doc/owlery-shared-mail-relay/ and the machine-readable source at https://octa.page/doc/owlery-shared-mail-relay.md 1. Owlery: shared outbound mail relay 1.1. Problem Several services on the same server called the Resend HTTP API directly, each with its own provider credential. This meant: o multiple copies of an equivalent secret, each rotated separately; o no per-application restriction on sender addresses; o no common delivery log or retry behavior. 1.2. Design Owlery is the single holder of the provider key. It exposes the same request shape as Resend's send endpoint, so migrating a caller means changing the base URL and the key. It is reachable only inside the private network. | Concern | Mechanism | | ------------------ | ------------------------------------------------------------ | | Caller identity | OneHi application keys, validated through `@onehi/client`; the key label names the application | | Authorization | One rule per label: permitted senders (exact address or domain wildcard) and a sending quota. Unknown labels are rejected | | Provider failure | Message is queued and retried with increasing backoff | | Duplicate delivery | The message id is reused as the idempotency key on every retry | | Persistence | SQLite for queue and log, with a JSON mirror of the rules | | Operation | Web UI with an inbox-style log, usage per key, retry and discard actions, and compact rule editing | 1.3. Key decisions Application keys instead of network identity. Most callers run on the same host, so network-level identity cannot distinguish them. Identity provider outage. The key check in "@onehi/client" returns "null" both for an unknown key and when OneHi cannot be reached. Rather than changing the client or adding a persistent key cache, Owlery performs a separate health check on "null": | Key check | OneHi health | Outcome | | ----------- | ------------- | ------------------------------------------------------------ | | Known label | not consulted | Rules applied, message sent | | `null` | healthy | Rejected, nothing stored | | `null` | unreachable | Accepted as pending; the key is revalidated before any delivery | Callers treat the pending response as accepted, and Owlery owns the retry. Calling by service name. All callers, including the monitoring service, use the relay's internal domain instead of loopback. This works across machines on the private network, at the price of making alerts depend on the reverse proxy. 1.4. Result OneHi, Gringotts, Holdings and Osservatore now send through Owlery, each with its own key and sender rule. Inbound mail was evaluated as a proxy through the relay. One constraint shaped the outcome: MX records bind reception for a whole domain to one service, and the provider's inbound webhook fires for the entire account. Christian Elías Informational [Page 1]