Skip to content

v1 Mail API: show when a mailbox address's domain is turned off #131

Description

@awizemann

Problem

An owner can turn off an email domain on the Domains page, or disconnect it. HQBase then stops
receiving and sending mail for every mailbox on that domain.

A client of the v1 Mail API cannot see this. GET /api/v1/mailboxes returns each mailbox with an
addresses list. Each address has mailDomainId, but nothing tells the client whether that domain
is active. The mailbox itself still shows isActive: true, receiveEnabled: true, and
sendEnabled: true.

The result: native clients (for example, the Herald macOS client) keep showing mailboxes on a
turned-off domain as normal. The user can pick one as a sender, and the send then fails on the
server.

Why the admin API does not help

The domain switch lives in the admin API (GET/PATCH /api/domains). The v1 OpenAPI document says:
"Administrative APIs are not part of this contract." The admin API uses a browser session cookie
and owner or admin role. A v1 client uses an OAuth token with mail:* scopes and cannot call it.
Members cannot call it at all. So v1 clients have no supported way to learn the domain state.

Proposal

Add one boolean to each v1 MailboxAddress:

{
  "id": "mbx_…",
  "mailboxId": "mbx_…",
  "mailDomainId": "dom_…",
  "address": "team@example.com",
  "displayName": "Team",
  "receiveEnabled": true,
  "sendEnabled": true,
  "isPrimary": true,
  "domainEnabled": false
}

domainEnabled is the value of mail_domains.is_enabled for the address's domain. It is false
when the owner turns the domain off, and also when the owner disconnects the domain (disconnect sets
is_enabled = 0).

Compatibility

  • The v1 document says additive fields may be added within v1 and clients must ignore unknown
    response fields. This is one new field. No field changes or goes away.
  • v2, the MCP tools, and the admin /api/mailboxes list stay unchanged.
  • The server already checks is_enabled = 1 before it delivers or sends mail, so the new field
    only exposes a state the server already enforces.

Open question

v2 Mailbox has the same gap (it has mailDomainId but no domain state). I kept this change to v1
because that is what our client uses today. I can add the same field to v2 in this change or in a
follow-up if you prefer.

I have the change ready and will open it as a PR with a spec-first companion in hqbase-site.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions