Table of Contents

The client endpoint

Where the MailFathom client reaches the service, what a deployment has to enable before it answers, and what a person's mail client presents to get in.

It is a third transport surface beside the two that already exist, and it is deliberately not either of them with more routes on it. An agent's key, an operator's key, and the credential somebody signs their own mail client in with are three things to provision and three things to revoke; keeping them on separate listeners with separate credentials is what makes that a fact rather than a convention.

What it draws on is the mailbox rather than a vocabulary of its own. A grant written here comes from the same half of the published set the MCP endpoint's grants come from, because the client reads the mail an agent reads. Only the transport is new.

The endpoint is off unless you turn it on

A deployment that configures nothing serves no client surface, so adopting a release opens no new network door onto a mailbox. Enabling it opens a listener of its own:

{
  "ClientEndpoint": {
    "Enabled": true,
    "Port": 8080,
    "Cors": { "AllowedOrigins": [ "https://mail.example.test" ] },
    "Authentication": [
      {
        "Method": "oauth-subject",
        "OAuth": {
          "Resource": "https://mail.example.test/api/client",
          "AuthorizationServers": [
            { "Name": "workforce", "Issuer": "https://sso.example.test/realms/mailfathom" }
          ]
        }
      }
    ]
  }
}

The listener is its own, and that is the point. Client routes answer on the client listener and nowhere else, and a request for /api/client arriving on the MCP or the administrative port is refused before it reaches any credential check — answered 404, because the honest answer is that nothing is served there. The default port is the other surfaces' own, so enabling several without stating a port publishes one socket serving each of them at its own prefix rather than three sockets; sharing a socket states what that couples and what stays each surface's own.

Every key this section takes is in endpoint configuration, with its default and its constraint.

A normal local aspire run is the development exception to that default. It enables the surface on a loopback socket of its own and admits the password method, so whatever a developer points at it has something to reach. The AppHost provisions its synthetic credential after the service reports ready; the client surface records the complete local topology and credential.

What it serves

Route Grant it needs
GET /api/client/sign-in-methods none
GET /api/client/session none
POST /api/client/session/token none
POST /api/client/session/token/revocation none
GET /api/client/accounts mailfathom.mail.read
GET /api/client/folders mailfathom.mail.read
GET /api/client/managed-folders mailfathom.mail.read
POST /api/client/managed-folders mailfathom.mail.folders.write with mailfathom.mail.read
POST /api/client/managed-folders/renames mailfathom.mail.folders.write with mailfathom.mail.read
POST /api/client/managed-folders/moves mailfathom.mail.folders.write with mailfathom.mail.read
POST /api/client/managed-folders/deletions mailfathom.mail.folders.write with mailfathom.mail.read
GET /api/client/emails mailfathom.mail.read
GET /api/client/emails/search mailfathom.mail.read
GET /api/client/emails/search/phrasing mailfathom.assistant.use
POST /api/client/emails/search/phrasing mailfathom.assistant.use
GET /api/client/threads/{threadId} mailfathom.mail.read
GET /api/client/threads/{threadId}/state mailfathom.mail.read
GET /api/client/messages/{storedEmailId} mailfathom.mail.read
GET /api/client/messages/{storedEmailId}/body mailfathom.mail.read
GET /api/client/messages/{storedEmailId}/body/cleaned mailfathom.assistant.use with mailfathom.mail.read
GET /api/client/messages/{storedEmailId}/attachments/{position} mailfathom.mail.read
POST /api/client/citations/resolution mailfathom.mail.read
GET /api/client/mutations mailfathom.mail.read
POST /api/client/mutations/flags mailfathom.mail.flags.write
POST /api/client/mutations/flags/withdrawals mailfathom.mail.flags.write
POST /api/client/mutations/moves mailfathom.mail.move
POST /api/client/mutations/moves/withdrawals mailfathom.mail.move
POST /api/client/mutations/deletes mailfathom.mail.delete
POST /api/client/mutations/deletes/withdrawals mailfathom.mail.delete
POST /api/client/mutations/deletes/releases mailfathom.mail.delete
GET /api/client/record mailfathom.mail.read
POST /api/client/record mailfathom.mail.accounts.write
GET /api/client/record/mail-accounts mailfathom.mail.read
POST /api/client/record/mail-accounts/folders mailfathom.mail.accounts.write
POST /api/client/record/mail-accounts/folders/replacement mailfathom.mail.accounts.write
POST /api/client/record/mail-accounts/folders/removal mailfathom.mail.accounts.write
GET /api/client/display-name mailfathom.profile.read
POST /api/client/display-name mailfathom.profile.write
GET /api/client/time-zone mailfathom.profile.read
POST /api/client/time-zone mailfathom.profile.write
GET /api/client/drafts mailfathom.mail.drafts.write
POST /api/client/drafts mailfathom.mail.drafts.write
GET /api/client/drafts/{draftId} mailfathom.mail.drafts.write
PUT /api/client/drafts/{draftId} mailfathom.mail.drafts.write
DELETE /api/client/drafts/{draftId} mailfathom.mail.drafts.write
POST /api/client/drafts/{draftId}/attachments mailfathom.mail.drafts.write
DELETE /api/client/drafts/{draftId}/attachments/{attachmentId} mailfathom.mail.drafts.write
POST /api/client/drafts/{draftId}/send mailfathom.mail.send
GET /api/client/replies/drafting mailfathom.assistant.use
POST /api/client/replies/drafting mailfathom.assistant.use with mailfathom.mail.read
GET /api/client/outbox mailfathom.mail.send
GET /api/client/outbox/{outgoingEmailId} mailfathom.mail.send
POST /api/client/outbox/cancellation mailfathom.mail.send
POST /api/client/outbox/requeue mailfathom.mail.send
GET /api/client/contacts mailfathom.contacts.read
GET /api/client/contacts/collected mailfathom.contacts.read
GET /api/client/contacts/{contactId} mailfathom.contacts.read
GET /api/client/contacts/{contactId}/correspondence mailfathom.mail.read with mailfathom.contacts.read
GET /api/client/contacts/{contactId}/relationship mailfathom.assistant.use with mailfathom.mail.read and mailfathom.contacts.read
POST /api/client/contacts mailfathom.contacts.write
PUT /api/client/contacts/{contactId} mailfathom.contacts.write
POST /api/client/contacts/{contactId}/promotion mailfathom.contacts.write
DELETE /api/client/contacts/{contactId} mailfathom.contacts.write
GET /api/client/notifications mailfathom.notifications.read
GET /api/client/notifications/unread-count mailfathom.notifications.read
POST /api/client/notifications/{notificationId}/read-state mailfathom.notifications.write
POST /api/client/notifications/read mailfathom.notifications.write
POST /api/client/notifications/deletions mailfathom.notifications.write
GET /api/client/tasks mailfathom.tasks.read
GET /api/client/tasks/proposed mailfathom.tasks.read
GET /api/client/tasks/today/layout mailfathom.assistant.use
POST /api/client/tasks/today/layout mailfathom.assistant.use with mailfathom.tasks.read and mailfathom.calendar.read
GET /api/client/tasks/{taskId} mailfathom.tasks.read
POST /api/client/tasks mailfathom.tasks.write
PUT /api/client/tasks/{taskId} mailfathom.tasks.write
POST /api/client/tasks/{taskId}/completion mailfathom.tasks.write
POST /api/client/tasks/{taskId}/acceptance mailfathom.tasks.write
DELETE /api/client/tasks/{taskId} mailfathom.tasks.write
GET /api/client/calendar mailfathom.calendar.read
GET /api/client/calendar/{eventId} mailfathom.calendar.read
POST /api/client/calendar mailfathom.calendar.write
PUT /api/client/calendar/{eventId} mailfathom.calendar.write
POST /api/client/calendar/{eventId}/acceptance mailfathom.calendar.write
DELETE /api/client/calendar/{eventId} mailfathom.calendar.write
POST /api/client/calendar/import/summary mailfathom.calendar.write
POST /api/client/calendar/import mailfathom.calendar.write
GET /api/client/calendar/drafts mailfathom.assistant.use
POST /api/client/calendar/drafts mailfathom.assistant.use
GET /api/client/preferences mailfathom.profile.read
POST /api/client/preferences mailfathom.profile.write
GET /api/client/portrait mailfathom.profile.read
POST /api/client/portrait mailfathom.profile.write
DELETE /api/client/portrait mailfathom.profile.write
POST /api/client/discovery/runs mailfathom.assistant.use with mailfathom.mail.read
GET /api/client/discovery/runs/{runId} mailfathom.assistant.use
DELETE /api/client/discovery/runs/{runId} mailfathom.assistant.use
GET /api/client/agent/conversations mailfathom.assistant.use
POST /api/client/agent/conversations/search mailfathom.assistant.use
GET /api/client/agent/conversations/{conversationId} mailfathom.assistant.use
DELETE /api/client/agent/conversations/{conversationId} mailfathom.assistant.use
PUT /api/client/agent/conversations/{conversationId}/archive mailfathom.assistant.use
DELETE /api/client/agent/conversations/{conversationId}/archive mailfathom.assistant.use
POST /api/client/agent/conversations/{conversationId}/messages mailfathom.assistant.use
POST /api/client/agent/conversations/{conversationId}/runs/{runId}/messages mailfathom.assistant.use
DELETE /api/client/agent/conversations/{conversationId}/runs/{runId} mailfathom.assistant.use
PUT /api/client/agent/conversations/{conversationId}/proposals/{proposedAt} mailfathom.assistant.use
POST /api/client/signals/ticket mailfathom.mail.read with mailfathom.notifications.read
POST /api/client/telemetry/v1/traces none
POST /api/client/telemetry/v1/metrics none
POST /api/client/telemetry/v1/logs none

No path here carries a version segment MailFathom chose: the major version is 0 and ADR 0004 permits breaking the contract outright, so /v1 would be scaffolding for a promise this project has not made. The /v1 in the three telemetry routes is not one: those paths are fixed by the OTLP specification, so a client points its exporter at the prefix above them and appends nothing itself.

The sign-in methods route

It answers a browser holding nothing, because a sign-in screen has to be drawn before anybody can authorize, and it is the one question the two documents a client could already read do not answer between them. The session route's challenge says whether a password would be taken; the RFC 9728 document names the issuers a token may come from. Neither says which servers a person may be offered a control for, what to write on the control, or the identifier the authorization request has to start with.

{
  "acceptsPassword": true,
  "authorizationServers": [
    {
      "issuer": "https://sso.example.test/realms/nordwind",
      "name": "keycloak",
      "displayName": "Nordwind staff directory",
      "clientId": "mailfathom-client"
    }
  ]
}

acceptsPassword is whether any configured entry accepts password, and it is true where the endpoint is configured with no entry at all — such an endpoint requires no credential, so a password is a thing a client may present rather than one it may not. Each server is one ClientEndpoint:Authentication:<n>:OAuth:AuthorizationServers:<m> block that was written with a ClientId, in the order the configuration published them; a block without one goes on validating tokens and appears here not at all. name is what a client matches its provider marks against, self meaning the deployment's own identity provider; displayName is the words the control carries and defaults to the name. Offering a person a provider to sign in with is the configuration side.

Nothing in the document is a secret. An issuer, a name, and a public client identifier all travel in the address bar of every authorization request the flow starts, so publishing them to a caller holding nothing gives away nothing it could not read there — and a deployment offering no provider publishes an empty list rather than a refusal.

A deployment built before this route existed answers 404, which a client reads as an older deployment rather than an unreachable one: it falls back to what the session route's challenge says about a password and draws the form.

The session route

It answers with four fields: service, which is always MailFathom; version, the running release; permissions, the published names the caller holds — its user's grant, kept to what the credential it presented names — in the order this project publishes them; and telemetry, how much of a client's own telemetry this deployment wants forwarded. permissions is computed on every read rather than copied from the credential, so a role assigned or revoked since the sign-in is already in it, and a credential naming no permission reports exactly what its user's roles grant. The one change a session meets only at its next sign-in is a user-facing permission a later release publishes: a session records what its credential narrows the grant to when it is minted, every renewal carries that forward, and a credential naming nothing is recorded as every user-facing name the release that minted it published.

That is what a client needs before it has drawn a single message: that this is MailFathom rather than something else answering the port, which contract it speaks, and what the rest of the surface will serve it. It is also what lets sign-in be built and proven end to end before a screen exists — a client that reached here with a token it had just been issued knows the token works.

telemetry answers one of trace, debug, info, warn, error, fatal, none, and off. The first seven are the level this caller is asked for — whatever ClientEndpoint:TelemetryLevel states, unless this person's own record states a ClientTelemetryLevel of its own — and off is what a caller none of whose telemetry is taken is answered whatever either of them says. Those two questions are one field deliberately: whether anything is taken is decided before any level is — by whether the deployment named a collector at all, which is the condition that decides whether the telemetry routes are served, and for one person by whether those routes take anything from them — and a second field could disagree with the first about it.

none and off both ask for no log record, and they are not one answer. none is a level: this caller's client writes no log record whatever its severity, and goes on recording and exporting its traces and metrics, which the deployment forwards as under every other level. off stops all three signals, so it wins over every level, none included, and it has two causes: a deployment that named no collector, which answers it to everybody, and a settings policy forcing this person's own telemetry switch off, which answers it to them alone. Both say the same thing to a client — nothing it sends is taken — and the second is held as well as answered: the telemetry routes refuse every batch that person's client sends. A client that offers a person a switch over their own telemetry still offers it under none, because there is still something behind it.

Somebody whose record this replica does not serve is answered off as well, which is the one case that is neither of those two causes. A credential still authenticates while its holder's record is held back — under a policy this build cannot read, for one — and what such a policy forces for them cannot be known there. A force that lifted wherever a replica could not read it would not be a force, so the telemetry routes refuse that person and this route says so.

The person's own switch is not answered here. Somebody who turned their telemetry off themselves is still answered the level, because off tells a client there is nothing behind its switch, and that would take from them the control they turned it off with. Their answer travels on the preferences read instead, and the telemetry routes hold it either way.

It is not part of the grant, and it is the one field here that answers per person. No permission decides it and no credential's grant changes it; what changes it is whose record the credential named, because a level worth turning up for one person reporting a defect is not one a deployment turns up for everybody. The record's level is read on every session read, so raising or clearing one takes effect on that person's next read and on nobody else's. A caller that names no user is answered the deployment's own level, which is what every caller was answered before a record could state one.

A client reads the field to decide what it records at all and whether its own switch is worth offering; the only other way to find out is to export a batch and read the refusal — 404 where the deployment named no collector, 403 where this person's telemetry is not taken — which is finding out by doing the thing. A client reading an answer that omits the field, or one carrying a level this client does not know, treats it as off and sends nothing — which is what a client built before none existed does with that answer, traces and metrics included, until it is updated. info is the deployment default, and what each level costs a deployment is on the telemetry page beside the records it decides.

It has a second reader, holding nothing at all. A person naming their deployment in the client types a host, and the client asks here before it sends anything to that address, so a mistyped one is reported as an address that answers as nothing rather than as a sign-in that failed. Wherever the endpoint requires a credential — which is every deployment that configured one — such a caller is refused, and the refusal is itself the answer: every MailFathom surface challenges under the MailFathom protection space, and this endpoint's CORS policy names WWW-Authenticate among the headers a browser may read. A deployment that requires none answers the body instead, and service is what the client reads out of it.

It names no credential, which is the one way it differs from what GET /api/admin/session answers. That surface's reader is mfctl in an operator's own hands, and the deployment's configured name for the credential that authenticated is what tells them which of their own entries let them in. This surface's reader is a page holding a token, which brought no name and has nothing to do with one; a response echoing a deployment's configured identity for a credential would be a way to read configuration back out of the service from a browser.

A caller holding nothing reads an empty permissions list rather than a refusal, because "nothing" is the accurate answer to what such a caller may do, and because a credential retired by narrowing it to nothing — or a user no role is assigned to — should be distinguishable from one that no longer works.

It is the one route on this surface published under no permission, for the reason the administrative session route is: it reports the credential the caller already presented and the version this deployment already publishes, so putting it behind a permission would make that permission a component of every client grant.

The session token routes

A client presents its password once, here, and presents a token everywhere else.

POST /api/client/session/token
Authorization: Basic ...
{ "token": "mfs_QUJDREVGR0hJSktMTU5PUA.q1u3…", "expiresAt": "2026-09-08T21:41:00+00:00" }

The token is presented as a bearer credential — Authorization: Bearer mfs_… — on every other route on this surface, including this one. That is what the exchange is for. A password is verified by deriving a PBKDF2 record sized for authenticating a person, which is around half a second of the deployment's own processor; a client opens several requests to draw one screen, and a surface authenticating each of them that way spends that cost per request rather than per sign-in. Verifying a token is one indexed read and one fixed-time comparison, and no key derivation at all — which is the whole of what the exchange removes.

Every credential this deployment holds is exchanged here — a password, an API key, a signed assertion. Nothing else changes about them: the bound on guessing a password is the same bound, counted the same way per source and per whole login, organization included, because the exchange is where a password is presented and is therefore where that bound applies. A password is presented under the login the MCP endpoint describes — SHORTNAME/username for a member of an organization and username otherwise. The rest of the surface still refuses a request carrying no credential at all.

An access token is refused here, with 403. A session standing in for a token would outlive it: the token's own expiry, the authorization server revoking it, and the scopes that server's entry requires are each judged per request against the token, and none of them can be judged against a session this deployment minted. It also saves nothing — validating a token derives no key — so a caller presenting one presents it on every request, exactly as before. It costs such a caller nothing either: the client signs in with a user name and a password, so no screen reaches this route with an access token in the first place.

A client endpoint requiring no credential still answers the exchange, so the client's sign-in is one path rather than a posture it has to ask about first. The session it mints authenticates nothing, because nothing on such an endpoint is authenticated, and no credential stands behind it for an operator to end it by — erasing the user it names is what removes it.

A live token presented here renews it. The answer is a fresh token, and the presented one stops working — one sign-in to one live credential, with no separate renewal credential and no second route. The client renews an hour before the expiry it was given, so a client left open stays signed in and nobody types a password again. A read already on the wire when the renewal answers is therefore refused 401 for a token its own client has just replaced, which is an ordinary 401 in a log rather than a credential anybody stopped accepting: the client presents what it now holds and reads again instead of signing the person out.

POST /api/client/session/token/revocation
Authorization: Bearer mfs_…

Answers 204 and the token stops working on the next request rather than at its expiry. The client's sign-out asks for this and does not wait on the answer: a deployment that never heard still expires the token on its own.

A session this deployment is not holding is answered 401, and a deployment already holding as many sessions as it will hold answers 503. A deployment that could not reach its sessions at all answers 503 as well. They are three different things for a client to do: the first is signed in for again, the second and the third are tried again in a moment. The two 503s are told apart by the error code the answer carries: 33003 is the database that could not be asked, and the ceiling carries none. An operator meeting 33003 is looking for an unreachable database rather than for ten thousand live sessions, and the log entry the refusal wrote is where that failure is. The third refusal is also why an unreachable database is never reported as a refused credential: a client meets a 401 by asking a person for their password, and a database that is briefly away is not a reason to.

The lifetime is thirty days and it is not configurable. It is what the client's own sign-in screen states to somebody who asked to be kept signed in, so a shorter one here would make that screen promise something this deployment does not keep. What bounds the case a person is actually in is renewal rather than the number, so somebody who keeps using a client never meets the thirty days at all. An abandoned session stands for the whole of them unless an operator ends the credential behind it, which removes it there and then rather than waiting for a request nobody is going to make; the sweep is what reaches one nobody ended. Thirty days is therefore a length the deployment keeps rather than the most a session could last, which is what a restart used to make it.

An operator revokes sessions by revoking the credential behind them. Disabling or deleting a user credential over the administrative endpoint removes every session that credential minted, in the act itself rather than at the next request each of them makes — so it reaches an abandoned session as readily as an active one. Erasing the user does the same for every session of theirs, including one minted where no credential was required. Rotating a credential's material does not: rotation changes what may be presented at the exchange and says nothing about sessions already exchanged, so an operator ending somebody's sessions disables the credential rather than rotating it.

Ending them is an act rather than a race, and PostgreSQL is what makes it one. An exchange presenting a password authenticates against a row that is still enabled and spends around half a second deriving it, so it would otherwise write its session after the act meant to have ended it. What prevents that is the order the two take their rows in: the sign-in holds the user record and then the enabled credential row until it commits, and the disable removes the sessions in the same transaction that clears the flag. A disable arriving first therefore leaves the sign-in matching no enabled credential and refusing, and one arriving second waits for the sign-in and then removes what it wrote. A renewal is ordered the same way, so nobody outlasts the act by renewing across it.

Sessions live in PostgreSQL, which has three consequences an operator sees. A restart signs nobody out, because no replica holds anything a restart could lose. Every replica accepts a session any other replica minted and honours its revocation, so the endpoint needs no session affinity at any replica count and a deployment is free to scale out. And the deployment holds at most ten thousand live sessions, counted by the statement that writes one rather than by each replica separately, so raising the replica count does not multiply it: reaching that sweeps what has expired and, where that frees nothing, refuses a new sign-in with 503 rather than signing somebody else out. ADR 0033 is where that is recorded.

The token is unguessable and it is not a password. It is a sixteen-byte identifier and a thirty-two-byte secret, both from the platform's cryptographically secure generator, written together after an mfs_ prefix — the same shape a minted API key carries, so a secret scanner recognises one and an operator who finds an unexpected value can tell which of the two it is. Only the identifier is looked up; the secret is compared in fixed time. ADR 0023 is where what each head keeps, and the threat model that follows, is recorded.

The accounts route

GET /api/client/accounts

It answers with the mail accounts the signed-in user owns, and how current the local copy of each one is:

{
  "synchronizationEnabled": true,
  "accounts": [
    {
      "id": "5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10",
      "displayName": "Work mail",
      "synchronizationState": "Synchronized",
      "lastSynchronizedAt": "2026-08-15T10:00:00+00:00",
      "behind": false
    },
    {
      "id": "8e3f1a6b-2c4d-4f7e-a915-7b2d0c6e1f38",
      "displayName": "Private mail",
      "synchronizationState": "Failing",
      "lastSynchronizedAt": "2026-08-14T21:12:00+00:00",
      "behind": true
    }
  ]
}

id is the identifier the deployment generated for the account, unique across the whole deployment, and displayName is the name it is published under, unique within the user rather than across the deployment; both are MailFathom's own names for the mailbox. The mail server, the port, the user name, and every credential are deliberately absent, and so is everything of the mailbox itself — no message, no subject, no correspondent, no folder listing.

synchronizationState, lastSynchronizedAt and behind answer different parts of one question, which is why they are three fields rather than one:

synchronizationState What it says
Synchronized Progress has been committed and this deployment's most recent finished attempt did not fail
Failing This deployment's most recent finished attempt did not complete, whether or not it has ever synchronized
Unreachable The mail server did not serve this deployment within its resilience budget, so nothing is refreshing the copy and nothing here is wrong with it
NeverSynchronized No run has ever durably committed progress for the account

Unreachable is separate from Failing because the two ask different things of whoever reads them: an unreachable mailbox is waited out or looked at on the server, and a failing one is a mapping, a credential, or a defect. An account reaches it only when unreachability is the whole of what went wrong — a run that also failed some other way reached the server, so it reads Failing instead.

lastSynchronizedAt is when any of the account's folders last durably took something in, and is null where none ever has. How old is too old is the reader's judgement rather than this deployment's, so nothing here calls an account stale — an account that has been failing since yesterday and one nobody has written to since yesterday carry the same instant and are not the same situation.

behind is true when any of the account's folders ended its last attempt with mail it had not yet taken in. It is not a state, because a folder can be behind under any of them: an attempt that succeeded within its batch budget leaves mail for the next one, and a failing folder is usually behind as well. An account that is merely catching up is therefore Synchronized and behind, which is a different situation from an unreachable one and reads as one.

The state describes what the running process has observed. A process that has just started reports an account it has not run yet by what its stored progress says rather than by how its runs were going before the restart, because the backoff that was failing is not one this process is applying. A host shutting down mid-attempt is not a failure either: the supervisor counts it under none, so an account backed off for every restart would be one approached less often for being stopped.

synchronizationEnabled is the deployment's switch rather than the user's, and it is reported beside the accounts because no per-account value carries it: a copy that last moved a week ago means one thing where the deployment is still trying every few minutes and another where an operator switched synchronization off.

A user with no mail account reads an empty accounts list, which is a state to render rather than an error. A credential whose grant does not carry mailfathom.mail.read is answered 403 instead, naming the permission it lacks, so the two are never confused; naming it discloses nothing, since the session route already tells that same caller its whole grant. An account another user holds is absent exactly as an account this deployment does not serve is absent — nothing in the response, its timing, or its failure modes separates the two.

Nothing here contacts a mail server. The answer is composed from local state, so it is the same whether or not a mailbox is reachable at the moment it is asked, and asking cannot set the remote \Seen flag. It is bounded by how many accounts the user has and by nothing else — not by their folders, their messages, or how many times synchronization has run.

The folders route

GET /api/client/folders

It answers with the user's mailboxes and every folder in them, which is the one tree a mail screen is drawn from:

{
  "synchronizationEnabled": true,
  "accounts": [
    {
      "account": {
        "id": "5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10",
        "displayName": "Work mail",
        "synchronizationState": "Synchronized",
        "lastSynchronizedAt": "2026-08-15T10:00:00+00:00",
        "behind": false
      },
      "folders": [
        {
          "alias": "INBOX",
          "role": "Inbox",
          "path": [ "INBOX" ],
          "storedEmailCount": 4213,
          "unreadEmailCount": 12,
          "synchronizationState": "Synchronized",
          "lastSynchronizedAt": "2026-08-15T10:00:00+00:00",
          "behind": false
        },
        {
          "alias": "ARCHIVE-2024",
          "role": null,
          "path": [ "Archiwum", "2024" ],
          "storedEmailCount": 980,
          "unreadEmailCount": 0,
          "synchronizationState": "Synchronized",
          "lastSynchronizedAt": "2026-08-15T09:41:00+00:00",
          "behind": true
        }
      ]
    }
  ]
}

account is the accounts route's own answer, field for field, so a client parses one account shape across this surface and the two routes cannot come to disagree about what a mailbox is. That is why it is nested rather than flattened into the folders beside it.

The tree arrives in one request because it is one thing on screen. A client that read the folders here and the mailbox names from the accounts route would be composing one picture out of two answers, the second already stale relative to the first. The accounts route stays the cheaper answer for a client that only wants the mailbox list: counting a folder's mail is work proportional to the mail, so a client polling for whether a mailbox is reachable asks there and a client drawing a tree asks here.

role is the answer a client cannot work out for itself. Special-use folders are advertised by server attribute rather than by name, and the names differ per provider and per language, so a screen that guessed which folder is the sent one from its name would guess wrong on somebody's Polish provider. The value is one of Inbox, Archive, Drafts, Sent, Junk, Trash, All, Flagged, Important, or Outbox — the role configuration labelled the folder with, and null where it labelled it with none. Nothing is guessed from a folder's name to fill it in.

path is the folder's place on its mail server, outermost level first. It is split into levels rather than published as a path and a delimiter, so a client builds a tree without knowing that mail servers have hierarchy delimiters or which character this one chose. The last level is what a person recognizes as the folder's name; alias above it is MailFathom's own name for the folder — a configured, upper-cased value unique within its account — and is what everything else on this surface names the folder by. A server that reports no delimiter has a flat mailbox and the whole path arrives as one level.

path is read from the folder's declaration wherever it names one, and from what the account's last pass bound only for a folder found by the role it plays. A folder act writes the declaration and nothing else, so a folder just made, renamed, or moved is answered where the act put it on the FoldersChanged re-read that follows the act, rather than where the last pass found it — which for a folder just made is nowhere, until the next pass minutes later. A declared path is text somebody wrote and carries no delimiter, so it is split by the one the account's own bindings recorded; an account no pass has reached yet has recorded none, and each of its declared paths arrives as one level until one has.

path is what a tree nests by, and alias nests nothing. A folder made inside another is declared under its own name, and neither a rename nor a move changes its alias, so an alias says nothing about where a folder is — and a / in one is a character of the name rather than a level. Three levels is as deep as MailFathom's own client goes — it offers no way to make a fourth — but this surface neither imposes that ceiling nor promises one, so a client reading a deeper path draws it where it falls.

The counts are of the local copy, not of the mailbox. storedEmailCount is what this deployment holds and would serve, and unreadEmailCount is how many of those the mail server last reported without \Seen. A folder still being backfilled holds fewer than the server does, which is why the three freshness fields travel in the same object: a count read without them is a figure somebody would take for the mailbox's own. Reading the unread count sets nothing — the flags are a snapshot reconciliation wrote, and this endpoint speaks no mail protocol at all.

Each folder's synchronizationState, lastSynchronizedAt and behind mean exactly what they mean on an account, one folder at a time; the table above is the whole of it. An account's own reading is the reduction of its folders', so a tree and the mailbox list beside it never disagree: a folder that failed makes its account Failing, and an account is Unreachable only where being unable to reach the server is the whole of what went wrong.

The folders are the ones configuration maps, which is wider than the folders this deployment holds mail from. A folder an operator asked not to mirror is never scheduled, so no run discovers it, and a folder nothing has bound yet has no place in the hierarchy to report — both are present all the same, carrying NeverSynchronized, no path, and both counts at zero, because a folder MailFathom does not copy is still a folder the mailbox has and still a folder a move files into. A client that could not see one would be told an account has nowhere to put a deleted message while its mailbox has a trash folder. A folder an operator withheld from tools is the one that stays absent, for the same reason it is absent from every other read: this surface admits what configuration admits.

A user with no mail account reads an empty accounts list, and a credential whose grant does not carry mailfathom.mail.read is answered 403 — the same two answers the accounts route gives, because naming a user's folders is the same disclosure as naming their mailboxes.

The answer is bounded by the folders the user's accounts have, which configuration bounds, and by nothing the mailbox can grow. Nothing here contacts a mail server, and asking cannot set the remote \Seen flag.

The folder-management routes

GET  /api/client/managed-folders?account=5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
POST /api/client/managed-folders
POST /api/client/managed-folders/renames
POST /api/client/managed-folders/moves
POST /api/client/managed-folders/deletions

These are the one surface a person's folder acts go through, for every account. Nothing a request carries and nothing an answer returns says where the account's mail is kept: an act is asked for the same way whether the mailbox is the mail server's or MailFathom's own, and which of the two carries it is the service's to decide. On an account whose mailbox MailFathom holds, an act is a local commit reaching no server, under ADR 0034; on a mirrored account it runs on the account's mail server, under ADR 0007, axes L, M, and N. They are a different reading from the folders route, which is the tree a mail screen is drawn from and carries each folder's counts and how current it is; this one carries what may be done to each folder.

The read answers with the acts the account allows, the roles it still has no folder for, and its folders ordered by name:

{
  "allowedActs": ["Create"],
  "creatableRoles": ["Archive"],
  "folders": [
    { "id": "INBOX", "parentId": null, "name": "INBOX", "role": "Inbox", "allowedActs": [] },
    { "id": "PROJECTS", "parentId": null, "name": "Projects", "role": null, "allowedActs": ["Rename", "Move", "Delete"] }
  ]
}

A client draws its menus from that report rather than from a rule it holds a copy of. allowedActs on the account is Create or nothing, allowedActs on a folder is Rename, Move, and Delete together or nothing at all, and creatableRoles names the roles a creation may ask for, which is none where the account offers no Create. A folder is named by id everywhere, whose shape is not part of this contract — a client can only have got one from this route — so a rename or a move never invalidates a reference a client holds, and a client builds the tree from parentId. An account the caller does not hold is answered 404, and one the request does not name 400.

Each write takes a strict JSON body — a key nothing binds is refused — of at most 4096 bytes, and a body past that is answered 413 before the write is reached. It answers with the change made and the folder as it left it:

Route Body change
POST /api/client/managed-folders account, parentId (or null for the top), name, or role instead of both Created
POST /api/client/managed-folders/renames account, folderId, name Renamed
POST /api/client/managed-folders/moves account, folderId, parentId (or null for the top) Moved, or MovedToTrash where the new parent is the trash of a held account or a folder within it
POST /api/client/managed-folders/deletions account, folderId MovedToTrash, Erased, Deleted, or MarkedDeleted
{ "change": "Created", "folder": { "id": "CLIENTS", "parentId": null, "name": "Clients", "role": null, "allowedActs": ["Rename", "Move", "Delete"] }, "mailErasureDeferred": false }

A creation names either a name or a role. Naming a role asks for the folder an account files by — one of Archive, Drafts, Sent, Junk, and Trash, which is what creatableRoles publishes — and names neither a name nor a parent: the service gives such a folder the role's standard English name at the top of the hierarchy, so nobody is ever asked to name their own trash folder and the name is the same on every account of every deployment. A role the account already has a folder for is answered RoleAlreadyPlayed, and so is one whose place in the account's own record is taken — on a mirrored account a folder first created under the role's name keeps that name as its record of the folder however it is renamed afterwards, and creatableRoles stops offering the role while it does. A role no folder may be created for is answered 400. On a mirrored account the role is carried to the server with CREATE-SPECIAL-USE (RFC 6154) where the server advertises it, and MailFathom records the role either way.

A folder playing a role is never renamed, moved, or deleted, on any account: it is the place the account files something into, and every rule the folder routes of an account's own settings apply holds here too — Synchronize and CreateIfMissing are always true, a role is stated when a folder is declared rather than given to one declared without it, and an account has at most one folder per role. Its RemotePath, GenerateEmbeddings, and VisibleToTools stay editable there.

On an account whose mailbox MailFathom holds, a deletion is a move into the trash, with everything beneath the folder, and it is not held to the depth limit, since it takes the folder out of the hierarchy rather than deeper into it. Deleting a folder already inside the trash erases it: the folder and everything beneath it leave every listing when the request commits, and the messages in them are erased afterwards in bounded passes on the job queue. Five folders are supplied by the first read, act, or arrival that finds them missing — the inbox, drafts, sent, junk, and trash — so such an account's first read already lists all five and creatableRoles is empty.

On a mirrored account, each act runs on the mail server: CREATE for a creation and RENAME for both a rename and a move, over the one write connection an account holds, which selects no folder. A created folder joins what the account synchronizes in the same act and appears in the next read without waiting for a synchronization pass, and a renamed or moved folder stays synchronized under its new place — MailFathom's own name for a folder never moves, only the path behind it. What a deletion does there is the account's own setting: Delete on the server issues DELETE, takes the folder out of what the account synchronizes, and removes the mail stored from it, answering Deleted; Mark deleted only reaches the server not at all and marks the folder deleted in MailFathom, which takes it out of the tree and out of every mailbox query while the mail stays stored, answering MarkedDeleted. A folder the deployment's own configuration declares rather than the account's record is answered NotDeclaredByTheAccount: what an operator wrote is theirs to change.

The source is asked before anything is written down, so a server that refuses an act leaves nothing changed anywhere and a refusal is never half an act. Each act is bounded by the same timeout and retry rules every other write to that server carries.

Every write answers mailErasureDeferred, which is true only for an act whose mail erasure committed while the queue already held as many erasure passes as it accepts: the folder is gone, and its mail stays stored and out of every listing until the account's next erasure queues a pass.

A name is 1 to 255 characters after trimming, carries no control character, no format character such as a zero-width space or a bidirectional override, and no /, is unique among its siblings without regard to case, and is not INBOX at the top of the hierarchy. A held account's hierarchy is at most 16 levels deep and holds at most 1000 live folders.

What mail synchronization brings into a held account lands by correspondence. A message arriving from a source folder playing one of the five roles lands in that protected folder. A message from any other source folder lands in the local folder created for that folder the first time one arrived — named after the source folder's own name or, where that cannot be a top-level name, its alias, and matched by the source folder's alias, so renaming or moving the local folder keeps it. It lands in the inbox where that folder is now in the trash or has been erased, where the account is at its folder limit, or where neither name can be placed at the top of the hierarchy, because a top-level folder already carries it or because it is INBOX; no folder is created then, so a person who creates a top-level folder of the same name first sends that source's mail to the inbox. Creating folders this way raises folders.changed once the message commits.

A refusal is a problem response whose refusal member names it, so a client branches on the name rather than the prose:

Status refusal
404 AccountMissing, FolderMissing, ParentMissing
400 NameInvalid, InboxNameAtTopLevel
409 AccountNotHeld, ProtectedRole, NameTaken, NestedInItself, TooDeep, TooManyFolders, RoleAlreadyPlayed, NotDeclaredByTheAccount, FoldersHeldByPolicy
502 ServerRefused
503 ServerUnavailable
500 NotRecorded

AccountNotHeld is what every act on an account being restored to its source answers, which is the one phase that allows nothing. ServerRefused and ServerUnavailable say the mail server refused the act or did not answer, and nothing was changed on either side. NotRecorded is the one refusal that leaves the two sides disagreeing: the server carried the act out and MailFathom could not write it down, so the folders are read again before anything else is asked.

A settings policy that holds Folders against the person closes these routes for that account. What they may act on is what the person may state afresh, so where a policy forces the account's list of folders or its editing restriction withholds it — how a settings policy resolves a mail account — no folder of the account is answered as one it declares, and renaming, moving, or deleting one answers NotDeclaredByTheAccount before any mail server is reached. Creating a folder names none the account declares, so on a mirrored account it is refused under a name of its own and just as early: it answers FoldersHeldByPolicy, no mail server is asked for anything, and no folder is made there that the account could not declare. The read says so before anybody asks — such an account's allowedActs carries no Create and its creatableRoles is empty — and the same holds for an account governed by a policy this build does not read. A folder of a default's list is one the account is served rather than one it states, and is acted on like any other; the first act writes the resulting list onto the account.

The read takes mailfathom.mail.read and the writes take mailfathom.mail.folders.write as well as mailfathom.mail.read, because an act is dispatched from the account's own folders and a credential that may not read them cannot be told which act it just asked for; each committed write is written to the service log as an audit record naming the account, the folder's identity, and the kind of change — never a folder's name — and tells the caller's clients over the signal channel that the folder set moved.

The mail list route

GET /api/client/emails?account=work&folder=INBOX&pageSize=50

It answers with one page of the user's mail, ordered by when each message was received, and with the cursor that continues the list at each end:

{
  "emails": [
    {
      "id": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "account": "5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10",
      "folder": "INBOX",
      "threadId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
      "subject": "Release 0.8.0 is out",
      "receivedAt": "2026-08-15T09:58:00+00:00",
      "sentAt": "2026-08-15T09:57:12+00:00",
      "senderAddress": "releases@example.test",
      "senderDisplayName": "Example Releases",
      "toAddresses": [ "somebody@example.test" ],
      "unread": true,
      "flagged": false,
      "answered": false,
      "hasAttachments": true,
      "attachmentCount": 2,
      "sizeOctets": 48213,
      "preview": "The release went out this morning and the notes are attached.",
      "enrichment": {
        "derivedAt": "2026-08-15T10:02:44+00:00",
        "marks": [
          {
            "aspect": "Sense",
            "text": "The 0.8.0 release notes, with the changelog attached.",
            "reason": "The opening paragraph announces the release and names the attachment.",
            "dueAt": null,
            "source": "Model",
            "origin": "mailfathom-email-enrichment",
            "evidence": [ "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a92" ]
          }
        ]
      },
      "threadMessageCount": 4
    }
  ],
  "nextCursor": "AbCd...",
  "previousCursor": null,
  "pageSize": 50
}

A row is everything a list draws and nothing else. Who wrote it, what it is about, when it arrived, whether it has been read, flagged or answered, whether anything is attached, and the opening of the message's own text. There is no body and no raw MIME on this route at all: a page of fifty rows each carrying a body is a megabyte to draw a list, and reading a message is a different request.

preview is at most 200 characters of the message's own text, with runs of whitespace collapsed to single spaces, cut by PostgreSQL rather than by the service — so a body never crosses out of the database to produce one. It is the text as extraction trimmed it, without quoted history or a signature block, which is what keeps a reply's preview from being the message it was answering. It is null for mail this deployment has stored but not yet extracted, which is not the same as a message whose text is empty. The bound is fixed: no request may raise it and no deployment may change it.

threadMessageCount is how long the correspondence is, counted over the whole conversation rather than over the page — a correspondence spans a page boundary as readily as it sits inside one, so a client counting the rows it holds would answer a different number depending on where the page was cut. It is counted across every folder the user may read with the junk folder included, which is the same membership GET /api/client/threads/{threadId} reads under. It is null for a message threading has placed in no conversation, and 1 for one whose conversation holds only it. The count comes out of the same read the page comes from rather than a request per row.

It is the one place a conversation's length is published without the assembly bound. The two routes agree up to the 500 messages the conversation route assembles and part above it: a correspondence longer than that is reported here as the length it actually is, while GET /api/client/threads/{threadId} reports messageCount as 500 and says so with moreMessagesNotAssembled. That is deliberate. What a client draws this field as says this row stands for a long exchange, which a number capped at the bound would stop saying — and making the two agree would mean counting the conversation a second time to publish a number the conversation route already states.

enrichment is what a derivation concluded about the message, and it is on every row of every response, whether or not the deployment turned message enrichment on. It carries at most three marks, one of each aspect — Sense, Significance, Commitment — each with the sentence itself, the reason behind it, the source and origin that produced it, and the evidence it rests on. dueAt is set only on a commitment whose message named a date.

Two states reach a client and they mean different things. The field is null for a message no derivation has reached — which is every message on a deployment with the switch off. It is an object with an empty marks array for one a derivation settled with nothing to say. A client may draw the two identically, but it can tell them apart, which is what the shape exists for.

evidence names passages rather than carrying them. Each entry is a passage identifier, resolvable through the same citation route an answer's citations use, so a client that wants the words behind a mark asks for them. A row carrying the passages themselves would be a list page publishing a body it had no reason to. An identifier that resolves to nothing is a message whose text has since been re-cut, not a broken row.

The cursor is opaque and yours to hold. It names a row of the page together with the list it was read under, and nothing on the server remembers it, so a client may keep one while the screen is closed, or across a restart of the deployment, and continue from it afterwards. nextCursor reads the page after this one and previousCursor the page before it; either being null means that end of the list has been reached. A page that came back empty carries neither, and a client that asked to scroll back from the first row it holds keeps the cursor it already had.

Scrolling back is the same list read the other way, never a re-sort. direction=backward returns the page before the cursor, still in the order the list is sorted in, so a client prepends what it receives. It continues from a cursor and from nothing else: direction=backward with no cursor is refused, because there is no page before the leading end and answering with the leading page would read as having scrolled to the top.

Parameter Accepts Default
account An account identifier or display name every account the user owns
folder A folder alias, or a role as role:Inbox every folder of those accounts
includeJunk true, false false
unread true, false both
flagged true, false both
hasAttachments true, false both
receivedOnOrAfter A timestamp, inclusive no start
receivedBefore A timestamp, exclusive no end
carriesMark Sense, Significance, Commitment any reading, and mail with none
markDueOnOrAfter A timestamp, inclusive no start
markDueBefore A timestamp, exclusive no end
sort receivedAt receivedAt
order newestFirst, oldestFirst newestFirst
direction forward, backward forward
pageSize 1 to 100 25
cursor A cursor a previous page returned the leading end of the list

The three mark parameters narrow by what an enrichment already derived, and derive nothing. carriesMark keeps the mail one of this deployment's own readings was recorded on, spelled exactly as enrichment.marks[].aspect publishes it on a row of this same route, so a client hands back the value it read rather than translating between two spellings of one closed set. markDueOnOrAfter and markDueBefore bound the instant a mark falls due at, which only a Commitment carries, and every criterion is met by one mark rather than by the message as a whole — a message whose Sense mark is old and whose Commitment is due tomorrow answers carriesMark=Commitment&markDueBefore=… and not carriesMark=Sense&markDueBefore=…. A deployment that has read nothing answers each of them with an empty page: that is a list narrowed to no mail rather than a failure, and nothing here asks for a reading to be produced. A range whose end falls on or before its start is refused with 400 like every other, rather than answered empty.

A value this deployment cannot honour is refused with 400, never ignored. sort=subject is the case worth naming: the list is ordered by the column the timeline indexes are ordered by, and a screen that asked for something else and was handed the default order would have no way to tell. The same holds for an unknown order or direction, a folder naming neither an alias nor a role, a pageSize outside the range, and a cursor — a cursor this deployment never issued and a cursor issued for a different list are refused separately, because they are two mistakes with two repairs. What is never returned instead is the first page.

A parameter sent empty is a parameter that was not sent, and sort, order and direction are matched without regard to case. A query string is composed by a page rather than typed, so a field the screen has nothing to put in yet arrives as ?folder=; making that mean something other than "every folder" would be a refusal no client could act on.

Filtering is what a list offers, not what a search does. The parameters above are the controls a person can see on a mail screen. A phrase from the body ranks rather than orders, and is the search route instead.

The filters are part of what a cursor was issued for, so changing any of them — or the order — makes a cursor taken before the change belong to a different list. Changing pageSize alone does not: page size moves no boundary.

The page is served from the local copy. Nothing here contacts a mail server, so no screen waits on IMAP, and reading a folder cannot set the remote \Seen flag. How current that copy is, per folder, is what the folders route answers; it is not repeated on every page.

A user with no mail account reads an empty emails list, and a credential whose grant does not carry mailfathom.mail.read is answered 403.

The mail search route

GET /api/client/emails/search?query=invoice%20from%20accounting&folder=INBOX&pageSize=20

It answers with one page of the user's mail ranked against what they are looking for:

{
  "results": [
    {
      "id": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "account": "5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10",
      "folder": "INBOX",
      "threadId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
      "subject": "Invoice 4471",
      "receivedAt": "2026-08-15T09:58:00+00:00",
      "sentAt": "2026-08-15T09:57:12+00:00",
      "senderAddress": "accounts@example.test",
      "senderDisplayName": "Example Accounting",
      "toAddresses": [ "somebody@example.test" ],
      "unread": false,
      "flagged": false,
      "answered": false,
      "hasAttachments": true,
      "attachmentCount": 1,
      "sizeOctets": 48213,
      "preview": "The invoice for August is attached and due at the end of the month.",
      "snippets": [ "The **invoice** for August is attached" ],
      "matchedBy": "BothRankings",
      "attachmentMatches": [
        {
          "attachmentPosition": 0,
          "fileName": "invoice-4471.pdf",
          "mediaType": "application/pdf",
          "source": "Document",
          "segmentKind": "Page",
          "segmentNumber": 2,
          "extracts": [ "**Invoice** 4471 is payable within 30 days" ]
        }
      ],
      "isDepictedMatch": false
    }
  ],
  "nextCursor": "AbCd...",
  "pageSize": 20,
  "retrievalMode": "Hybrid",
  "semanticSearch": "Available",
  "includedJunkMail": false
}

One route searches by words and by meaning at once. A person looking for a message does not know whether the words they remember are the words the message used, so there is no parameter that chooses between the two: the deployment ranks both ways wherever it can, and the answer says which happened. Search is where the two rankings and their fusion are described.

A result is a list row with two fields added, so one layout draws both and a result can be opened, filtered, and acted on without a second request. snippets are the extracts around what matched, each marking the matched words with ** — text cut from untrusted mail rather than markup to render — and preview is the same bounded opening the list route publishes. The one list field a result does not carry is threadMessageCount: a search ranks messages rather than correspondences, and counting the conversation behind every result would be a query this route does not owe.

matchedBy is why the row is there: LexicalRanking for a message carrying the query's words, SemanticRanking for one matching by meaning, and BothRankings for one both rankings found. It is the field a screen needs most for the second of those: a semantically ranked message carries no snippets, because there is no extract of it that shows the query's words, and a row with nothing under it would otherwise read as unexplained. On a lexically ranked page every result is LexicalRanking by construction.

attachmentMatches is the other half of that answer: what the query matched inside a file the message carries. Attachment text is never folded into snippets, which are extracts of the message body alone — quoting a file into one would report words the body never carried and leave a reader unable to say which file they came from. Each entry names the file and the place inside it: attachmentPosition is the coordinate the attachment route is addressed with, fileName and mediaType are what the sender declared, segmentKind is Page, Slide, or Sheet with segmentNumber beside it, and extracts are bounded extracts of that file's text marked the same way snippets are. segmentKind and segmentNumber are null together for an attachment read before boundaries were recorded, which is a citation naming the file and not a place inside it. An attachment MailFathom could not read — encrypted, corrupt, unsupported, or carrying no text layer — is absent rather than present and empty, exactly as it is from the MCP tools.

source says who wrote the words, and isDepictedMatch says whether that is the whole story. Document is the file's own text, read out of it by a parser or transcribed by a model from a picture of a page such as a scanned invoice, and reachable by word and by meaning alike; ImageDescription is a model's account of what a picture shows, which nobody wrote and which is reachable by meaning alone, so its extracts carry the description itself rather than fragments cut around the query. isDepictedMatch is true only when a description is the entire reason the message is in the list: every such result sits below every result a query word or written text reached, so a picture never displaces a written match and only ever adds a message that would not have been in the list at all. A screen showing one owes the reader that distinction — the source is a guess about an image. ADR 0030 is the decision, and the same partition serves the MCP tools.

hasAttachments is unchanged by any of this. It constrains by attachment presence — mail carrying a file — and never by whether a file matched. The two are different questions, and a filter that quietly became the second would hide every message whose attachment the query never reached.

retrievalMode and semanticSearch are how a narrower answer says it is narrower. Lexical means this page was ranked by words alone; Hybrid means both rankings took part. What separates a deployment that deliberately does not embed from one whose provider is refusing is the field beside it: Inactive is the first, Degraded the second, and Available is a deployment ranking by meaning. A search is never refused because an embedding provider was unreachable — it is answered lexically and says so, which is what makes the degradation something an operator can act on rather than results that quietly got worse.

Parameter Accepts Default
query The text to search for, up to 512 characters required
account An account identifier or display name every account the user owns
folder A folder alias, or a role as role:Inbox every folder of those accounts
includeJunk true, false false
sender An address the sender must carry any sender
recipient An address a To or Cc recipient must carry any recipient
unread true, false both
flagged true, false both
hasAttachments true, false both
receivedOnOrAfter A timestamp, inclusive no start
receivedBefore A timestamp, exclusive no end
pageSize 1 to 50 20
cursor A cursor a previous page returned the best-ranked results

Every parameter beside query constrains rather than ranks. A person who narrowed to one sender and to last year has said which mail may come back, so those values decide what is eligible before anything is ranked and the query decides only the order of what remains. They are applied inside the ranking query rather than to what it returned, which is what keeps a page from being filled by mail the filters exclude and then emptied.

A query that matched nothing is answered with nothing. results comes back empty and nextCursor is null, rather than the page being filled with the nearest mail — so a person told the search found nothing knows to write a different one.

Paging walks forward through a ranked list of at most 200 results. nextCursor continues it and null means the list ends there; a client keeps the pages it has already drawn, because a relevance order is recomputed per query and there is nothing to scroll back to. What a ranked cursor cannot promise is what the list route's promises: a message indexed between two pages can move across a boundary a client is holding and be seen twice or not at all. Somebody who has read two hundred results without finding what they wanted narrows the filters, which is what would have found it sooner.

A value this deployment cannot honour is refused with 400, never ignored. A blank or over-long query, an address filter that is not an address, a folder naming neither an alias nor a role, a pageSize outside the range, and a cursor — a cursor this deployment never issued and a cursor issued for a different search are refused separately, because they are two mistakes with two repairs. What is never returned instead is the best-ranked page of a search nobody asked for. A refusal states what to change and never echoes what was sent: a query is the most revealing value this surface carries.

The page is served from the local copy, and only mail that has been extracted is searchable at all — a message this deployment has stored but not yet indexed matches nothing here. Nothing on this route contacts a mail server, so no search waits on IMAP and none can set the remote \Seen flag.

A user with no mail account reads an empty results list, and a credential whose grant does not carry mailfathom.mail.read is answered 403.

The phrasing routes

GET /api/client/emails/search/phrasing
{ "readsPhrases": true }
POST /api/client/emails/search/phrasing
Content-Type: application/json

{ "phrase": "unread mail from the supplier about the racking, since August" }
{
  "read": true,
  "filters": {
    "sender": "sales@example.test",
    "recipient": null,
    "receivedFrom": "2026-08-01",
    "receivedTo": null,
    "unread": true,
    "flagged": false,
    "hasAttachments": false
  },
  "criteria": ["racking"],
  "unaccounted": null
}

This route reads a sentence and searches nothing. What comes back is an interpretation the client draws as objects somebody can see, change, and take off, and the search route above is then asked with whatever survived that. A route that searched as well would make the interpretation invisible, and an interpretation nobody can see is one nobody can correct.

The read says whether this deployment reads a sentence at all, which is what decides whether a search field may offer to take one before anybody types. It resolves a registration and calls no provider, so a client asks it once and holds the answer. false is what a deployment with no chat section answers and what one whose operator wrote Chat:SearchPhrasing:Enabled off answers; the two are deliberately one answer, because what a client does about either is identical and naming which would publish a deployment's configuration to every signed-in browser.

filters are constraints and criteria are not, and the two are separate on the wire because they are two different promises: a constraint decides what may come back and a criterion only decides the order, so taking a criterion off widens what ranks well rather than what can be found. unaccounted is the part of the sentence nothing was made of, quoted from it — said rather than dropped, because a sentence half of which was silently discarded is a search nobody can correct.

The two days are calendar days, and the day they were resolved against is the caller's own. Every relative expression — last quarter, since Tuesday — is resolved against the day the person asking is standing on, which this deployment reads from the time zone their user record states rather than from anything the client sends; the days it resolved to come back so they can be seen and moved. The zone routes are where that value is read and corrected.

read: false is the plain word search rather than a failure. It is what a deployment reading no sentence answers, and what this one answers while its provider is unreachable or wrote something unreadable; a client searches the typed words and reports nothing. The one exception is a spend ceiling: a deployment that has spent what its operator allows a provider answers 429, because falling back there would spend the search on a call already declined.

The sentence travels in a body, which is why reading one is a POST for an operation that changes nothing: what somebody is looking for in their own mailbox is the most revealing value this surface carries, and a query string is the part of a request that reaches an access log by default — here and on every proxy in front of this deployment. A body over 4 KiB is refused before it is read, a blank or over-long sentence is refused with 400, and a refusal never echoes what was sent. The body is strict — a key nothing binds is refused with 400 — so a client still sending the day it asked on is told, rather than having the field dropped and the sentence read against this deployment's own clock.

Both routes are published under mailfathom.assistant.use rather than under the reading grant, because that is what they do: a sentence leaves this deployment for a chat provider and is charged to the same allowance a question is. A credential holding only mailfathom.mail.read is answered 403 and searches by words, which is the same search a deployment with no provider serves. Nothing about the sentence reaches a log or telemetry on either route.

The conversation route

GET /api/client/threads/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91?pageSize=50

It answers with one conversation as a single document — the messages in it, who wrote in it, and how big it is:

{
  "threadId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
  "messages": [
    {
      "position": 0,
      "answeredId": null,
      "email": {
        "id": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
        "account": "5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10",
        "folder": "INBOX",
        "threadId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
        "subject": "Release 0.8.0 is out",
        "receivedAt": "2026-08-15T09:58:00+00:00",
        "sentAt": "2026-08-15T09:57:12+00:00",
        "senderAddress": "releases@example.test",
        "senderDisplayName": "Example Releases",
        "toAddresses": [ "somebody@example.test" ],
        "unread": true,
        "flagged": false,
        "answered": false,
        "hasAttachments": true,
        "attachmentCount": 2,
        "sizeOctets": 48213,
        "preview": "The release went out this morning and the notes are attached.",
        "enrichment": {
          "derivedAt": "2026-08-15T10:02:44+00:00",
          "marks": [
            {
              "aspect": "Sense",
              "text": "The 0.8.0 release notes, with the changelog attached.",
              "reason": "The opening paragraph announces the release and names the attachment.",
              "dueAt": null,
              "source": "Model",
              "origin": "mailfathom-email-enrichment",
              "evidence": [ "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a92" ]
            }
          ]
        },
        "threadMessageCount": 2
      }
    },
    {
      "position": 1,
      "answeredId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "email": {
        "id": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a92",
        "account": "5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10",
        "folder": "SENT",
        "threadId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
        "subject": "Re: Release 0.8.0 is out",
        "receivedAt": "2026-08-15T10:04:00+00:00",
        "sentAt": "2026-08-15T10:03:41+00:00",
        "senderAddress": "somebody@example.test",
        "senderDisplayName": "Somebody",
        "toAddresses": [ "releases@example.test" ],
        "unread": false,
        "flagged": false,
        "answered": false,
        "hasAttachments": false,
        "attachmentCount": 0,
        "sizeOctets": 3120,
        "preview": "Thanks — I will read the notes this afternoon.",
        "enrichment": null,
        "threadMessageCount": 2
      }
    }
  ],
  "participants": [
    { "address": "releases@example.test", "displayName": "Example Releases", "messageCount": 1 },
    { "address": "somebody@example.test", "displayName": "Somebody", "messageCount": 1 }
  ],
  "messageCount": 2,
  "moreMessagesNotAssembled": false,
  "moreParticipantsNotNamed": false,
  "nextCursor": null,
  "pageSize": 50
}

A conversation is not scoped to a folder, and the route takes no account or folder to scope it by. The question is in the inbox, the answer is in SENT, and a forwarded copy is in a project folder — so it is read across every folder of every account the signed-in user owns, and the junk folder takes part too, because a reply that landed in junk is still part of the exchange somebody is reading. A folder an operator withheld from tools is the one exception, and it is absent for the reason it is absent everywhere: the message is in no conversation this surface publishes, in no count of one, and in no participant list.

What a conversation covers today is one account's mail. MailFathom assembles a thread from the mail of the account that holds it, so the same exchange in two of your mailboxes is two conversations with two identifiers, each complete within its own account. Nothing in this route narrows by account — it never asks which mailbox you were looking at — so what bounds a thread here is how threading is assembled rather than how it is served.

email is the mail list route's own row, field for field. A client parses one message shape across this surface, and its preview is what that message added with the quoted history and the signature block trimmed off — which is what keeps the eighth reply from redrawing the seven above it. Field for field includes enrichment, which carries here exactly what it carries on a list row and means exactly the same thing: a message a derivation reached shows its marks whichever screen draws it, and a conversation that answered null for a message the list shows marks for would be stating that no derivation has reached it. threadMessageCount on each of these rows is this conversation's own messageCount, because that is what the field means and every message here is in this conversation — so a row drawn from a thread reads the same number as the header above it. That is the assembled count rather than the counted one, so a conversation past the 500 this route assembles reads 500 here beside moreMessagesNotAssembled and reads its real length on a mail list row.

content=true adds the messages themselves, which is how a client draws a correspondence in one request. Without it every entry carries email alone and the whole of a message is a request of its own, named by the id that row already carries — which is what a client listing a thread wants. With it each entry gains two more fields, message and body, and they are the message route's and the message body route's own answers, field for field: a client that draws a conversation as a document of open messages parses one message shape across all three routes, and reading the earlier messages of an exchange costs nothing further on the wire.

Two things are decided by that being a content read rather than a listing. The page is bounded at 10, which is the ceiling any content read is held to: pageSize above it with content=true is refused with 400 rather than served half-drawn, pageSize is 10 by default here rather than 25, and a longer conversation is read on with nextCursor exactly as it is without content. And the three per-message asks are not made: the sender's own markup is absent (selfContainedHtml is null), no attachment download link is minted, and no remote image reference is resolved — each of those is a decision a reader makes about one message, and a conversation that took all three would mint a bearer credential per message and disclose the reader to every sender's host at once. A message whose local copy this deployment could not open carries message and body as null rather than being left out of the conversation, so a client draws the correspondence with a gap in it that can still be opened on its own.

position and answeredId are where the message sits. position is its zero-based place in the conversation's own order and continues across pages, so a client that has paged twice still knows what it is holding. answeredId names the message it answers among the ones you are shown — a message whose parent sits in a withheld folder is published as a root naming nothing, so the withheld message is not disclosed by the gap it would otherwise leave.

The order is the conversation's own, not a re-sort. The reply relation decides it wherever it is known, because it is the only statement about sequence a sender did not make about themselves; the sent time settles messages answering the same parent, and the local identity settles the rest so the order is total. For an ordinary exchange, where each message answers the one before it, that is chronological order — and a reply somebody's clock dated a year early still sits under what it answers rather than at the top of the screen. It is the same order the MCP surface publishes for the same conversation, so two clients of one deployment never see one exchange in two orders.

participants is who wrote, drawn from the whole conversation rather than the page. That is the point of it: a client draws the header from the first page without walking the messages. Each entry carries the address, the display name their most recent message wrote, and how many of the conversation's messages are theirs; a message with no usable sender names no participant. At most 50 authors are named, and moreParticipantsNotNamed says when a list expansion went past that. Addressees are not participants here — who a message went to is on the message.

messageCount is the whole conversation, and the page is bounded separately. A conversation is assembled to at most 500 messages the caller may see; moreMessagesNotAssembled is true when it runs past that, which is a mailing list's archive rather than correspondence somebody is following. Within it, pageSize messages are returned at a time and nextCursor continues from the last one; null means the conversation ends there. Paging runs forward from the beginning of the conversation, because that is how a thread is read.

The cursor names a message, not a position. The order is derived on every read, so a reply arriving in the middle moves positions and moves no message — and the next page is whatever follows the message the last page ended on. Three things are refused with 400, each saying which it is: a cursor this deployment never issued, a cursor issued for a different conversation, and a cursor whose message this conversation no longer shows, which is a message deleted or moved into a folder you may no longer read. The repair for the last one is to read the conversation from its beginning, which is why it is not answered with the first page — a thread that silently jumped back to the top would read as a defect in the client.

Parameter Accepts Default
threadId The conversation's identifier, as a message row published it required, in the path
pageSize 1 to 100, or 1 to 10 with content=true 25, or 10 with content=true
cursor A cursor a previous page returned the beginning of the conversation
content true to carry each message and its body beside the row false

A conversation this user does not hold is answered 404, and so is one no deployment ever held: nothing in the answer, its timing, or its failure separates somebody else's exchange from one that never existed. Text that is not a UUID matches no route and is the same 404. A credential whose grant does not carry mailfathom.mail.read is answered 403, as everywhere else on this surface.

The conversation is served from the local copy. Nothing here contacts a mail server, so no screen waits on IMAP, and opening a thread cannot set the remote \Seen flag.

The conversation state route

GET /api/client/threads/{threadId}/state answers with where one conversation stands, as a conversation's state describes: threadId, coverage (WholeThread or ThreadTooLarge, the second with no entries), derivedAt, current, and entries. Each entry carries its aspect, its text, the owedBy and dueAt only a commitment may carry, and its sources as citation targets the citation route resolves.

entries holds at most one statement per aspect, in aspect order, and a state recorded while more were kept answers with the first of each.

current is false once the conversation has changed since the state was derived — a message joined it or left it — decided by the comparison the derivation pass uses to find what it owes a new derivation. The record is still served, because it is the only record there is, and a client does not draw it as the conversation's current state.

A conversation with no state is answered 404: a deployment that never turned the derivation on, one that has not reached this conversation, and a conversation this user does not hold all answer the same way, and none of them is a failure. A credential whose grant does not carry mailfathom.mail.read is answered 403. Nothing on this route starts a derivation or reaches a provider.

The message route

GET /api/client/messages/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90

It answers with everything a reading pane draws around a message and none of what it draws inside one — the headers the message displays, what this deployment established about the author it displays, the files it carries, and which forms of its body exist to be asked for:

{
  "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
  "account": "personal",
  "folder": "INBOX",
  "threadId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
  "sizeOctets": 2416381,
  "headers": {
    "subject": "Release 0.8.0",
    "sentAt": "2026-08-27T09:14:00+00:00",
    "receivedAt": "2026-08-27T09:14:06+00:00",
    "participants": [
      { "role": "From", "address": "release@example.test", "displayName": "Release notices" },
      { "role": "To", "address": "reader@example.test", "displayName": null }
    ],
    "messageId": "release-0-8-0@example.test",
    "inReplyTo": null,
    "references": []
  },
  "body": { "availability": "Readable", "plainText": true, "html": true },
  "sender": {
    "authorAuthentication": "Authenticated",
    "deploymentTrust": "Trusted",
    "authenticatedDomain": "example.test"
  },
  "attachments": [
    {
      "position": 0,
      "fileName": "release-notes.pdf",
      "wasFileNameNormalized": false,
      "mediaType": "application/pdf",
      "sizeOctets": 2401337
    }
  ],
  "carried": {
    "attachmentCount": 1,
    "totalSizeOctets": 2401337,
    "inlineResourceCount": 2,
    "encrypted": false,
    "unverifiedSignature": false,
    "unexpandedTnefPart": false
  },
  "unread": true,
  "flagged": false,
  "answered": false
}

It is the other half of the pane, and the body is the first. The two are separate requests because they are separately expensive: a header block is drawn as soon as this answers, whatever the body costs, and a client that had asked for both at once would wait for the slower of them to draw either.

The headers are parsed from the stored message rather than read off a list row. That is why a display name, a Bcc the message carried for its own recipient, and the three threading identifiers are here and not on a row: the columns a list is served from keep the comparison forms a filter needs, and a reader shown those would be shown a narrower message than the one that arrived. A message whose content the size limit kept out of storage has the narrower set a row can answer for, which is what its availability says.

body says what the sender wrote, not what a request would return. The body route answers with words for every readable message, deriving them from the markup where the sender wrote no text part, so a returned representation says nothing about what arrived — and whether there is a richer rendering to draw is exactly what a pane is asking. html is true where the message carried an HTML part, which is what the body route's document is reduced from; both are false for a body nothing could read, and availability is the same set that route reports.

sender is two states and is never one. authorAuthentication is what the receiving mail server established about the author the message displays, and deploymentTrust is whether this deployment recognizes that author — a fact about the message beside a classification of a list. They are published side by side because collapsing them into one badge would mean inventing the rule that combines them: an authenticated author nobody has named is the ordinary state of legitimate mail and carries the same trust value as one whose authentication failed outright. Both are read back as they were stored; nothing on this path re-reads a header, resolves DNS, or evaluates a policy, so what a reader is shown is what was concluded about the authenticated author rather than a reading of the From header.

authenticatedDomain is who the authentication was established for, which is the fact a reader needs when the name a message displays is not it. It is the domain the receiving mail server authenticated and nothing wider: it is null for a message nothing authenticated a sender for, and it is published beside the two states rather than compared against the From address, because judging whether the two agree is the policy this path deliberately does not evaluate.

No octet of a file is here, at any size and in any encoding. Each entry says what the file is called, what it declares itself to be, and how large it decodes to — which is what a reader decides against — and position is what its own attachment route is asked with. The position is the identity because it is the only stable one a message's parts have: MIME gives an attachment no identifier, a Content-ID is optional and sender-chosen, and a file name is neither unique nor required. A file name is text a sender chose and arrives normalized to a bare name — never a path, never a traversal segment, never a control character — with wasFileNameNormalized saying whether that rewrote anything.

The pictures a message displays inside its own body are not in this list and are not a route. An inline part is resolved against the message's own parts while the body is reduced, so a sender's own images arrive drawn rather than as references a pane would have to fetch, and inlineResourceCount is where they are counted instead. That is also what keeps them from being confused with the remote ones, whose addresses are removed there rather than turned into something this surface would resolve.

carried is null rather than zero for a message nothing has ever parsed — the case of content the size limit kept out of storage. Zero would claim the message carries no files, which no local copy exists to support; attachments is empty beside it for the same reason.

Parameter Accepts Default
storedEmailId The message's identifier, as a list row or a conversation published it required, in the path

A message this user does not hold is answered 404, and so is one no deployment ever held, and so is one whose stored content is missing or damaged. Text that is not a UUID matches no route and is the same 404. A credential whose grant does not carry mailfathom.mail.read is answered 403, as everywhere else on this surface.

It is served from the local copy. Nothing here contacts a mail server, so no screen waits on IMAP, and opening a message cannot set the remote \Seen flag.

The message body route

GET /api/client/messages/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90/body

It answers with one message's body in both the renderings a reading pane draws from — the words, and the message reduced to a closed document tree — and, where the read asked for it, in a third the surface that opens the sender's own layout reads:

{
  "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
  "availability": "Readable",
  "plainText": {
    "text": "The release went out this morning and the notes are attached.",
    "originalCharacterCount": 61,
    "truncation": "None"
  },
  "document": {
    "schemaVersion": 1,
    "refusal": "None",
    "removedRemoteReferenceCount": 2,
    "retainedRemoteImageCount": 0,
    "inlineImageCount": 1,
    "undrawnInlineImageCount": 0,
    "truncated": false,
    "blocks": [
      {
        "type": "heading",
        "version": 1,
        "level": 2,
        "alignment": "Inherited",
        "content": [ { "text": "Release 0.8.0", "emphasis": "None", "foreground": null, "link": null } ]
      },
      {
        "type": "paragraph",
        "version": 1,
        "alignment": "Inherited",
        "content": [
          { "text": "The notes are ", "emphasis": "None", "foreground": null, "link": null },
          {
            "text": "on the site",
            "emphasis": "Underline",
            "foreground": "#0b57d0",
            "link": {
              "target": "https://example.test/notes",
              "host": "example.test",
              "asciiHost": null,
              "deception": "None"
            }
          }
        ]
      }
    ]
  },
  "selfContainedHtml": null,
  "remoteImagesRequested": false
}

Both renderings travel together, because a pane needs both: document says whether it was refused and plainText is what it falls back to. A client that had to ask twice would draw an empty pane in between. selfContainedHtml is present on every response and is null on a read that did not ask for it, which is what the example above shows.

The document is a closed tree, and that is the whole of what makes it safe to draw. It is not sanitized markup: it is a list of typed blocks, and every value in one is text, a number, a colour in #rrggbb, or a member of a fixed set. There is nowhere in it to put a script, an event handler, an embedded object, a form, a style sheet, or an element — so a construct nobody thought of cannot survive by being unfamiliar, and a renderer drawing it with its own typed controls cannot be steered by what a stranger wrote. type names the block and version names the revision of that block's own shape, so a client keys its renderers by the pair and shows a placeholder for a pair it does not implement rather than failing the message. The eight identities are paragraph, heading, list, table, quote, image, separator, and preformatted, each at revision 1, and schemaVersion names the revision of the document itself.

Nothing in a body reaches somebody else's server unless the reader asked. Every reference to a remote address is removed while the tree is built rather than left for a renderer to decline to follow, so a tracking pixel is defeated by the document not carrying it. removedRemoteReferenceCount is what survives instead — a count a pane can put in front of the reader — and it counts a remote img, a url( in a style declaration, and a background attribute alike. A picture the message carries itself is different and is resolved in the deployment: an inline part reached by Content-Id or Content-Location becomes a data: URI, bounded by count, by the size of each, and by how much they come to together, with inlineImageCount and undrawnInlineImageCount saying how many were drawn and how many were beyond a bound. That last bound is what makes this route's answer a size a client can plan for: a body is the one document this surface serves that carries a message's own content rather than a description of something, so a pane reads it against a ceiling of its own rather than against the megabyte every other route here is held to.

Asking for remote pictures is a second request, and nothing on either side remembers it:

GET /api/client/messages/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90/body?remoteImages=true

The answer then carries the absolute addresses of the pictures the message asked for, counted in retainedRemoteImageCount, and echoes the request in remoteImagesRequested. Nothing is written down: there is no per-sender allowance, no per-message allowance, and no setting, so opening the message again asks again. That is deliberate rather than unfinished — a remembered allowance is a standing consent that outlives the reason it was given, and the reader's own act is what should decide, message by message, whether a sender's server is told they opened it. Only pictures are ever retained; a style declaration's reference and a background attribute are dropped under both readings, because neither has anywhere in the contract to go.

Asking for the sender's own markup is a second request too:

GET /api/client/messages/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90/body?fullHtml=true

The answer then carries selfContainedHtml beside the two renderings above — text, originalCharacterCount, and truncation, exactly as plainText does — and null on every read that did not ask, so the default read is unchanged and pays for none of it. What it holds is the message's own layout with the message's own pictures inlined, with nothing in it that a renderer would run and nothing in it that resolves against another host. truncation reads InlineImageOctetLimit where the message carried more of its own pictures than one representation inlines, which is the one bound that leaves the words whole and the pictures short.

Both queries compose. remoteImages=true widens this representation further than it widens the tree — a background and a web font are restored beside the pictures, because a layout served without them is the reduction the surface was opened to escape — while an @import and the candidates of a srcset stay refused, because the first names a stylesheet the service never read and the second is a list the check behind the pass reads as one address, and nothing executable is restored by either query.

A link carries where it actually goes, and what the deployment made of how it was written. target is the resolved absolute address, carrying only http, https, or mailto — a javascript:, data:, vbscript:, or file: target is dropped and the words it was written on are kept. host is the host as a reader recognizes it and asciiHost is the same host in its ASCII form, present only where the two differ, which is what a homograph looks like. deception is DisplayedHostDiffers where the link's own text names one host and the link goes to another, NotApplicable where the text is not a place, and None where the two agree. The determination is the deployment's rather than each client's, so two clients reading the same message cannot disagree about how loudly to warn.

A body the reduction refuses is answered as its plain text with the reason beside it, in refusal: NoHtmlPart where the message carried no markup at all, ReductionFailed where the markup could not be read, NothingRenderable where it reduced to no content, and None where the document is the message. truncated says a bound stopped the reduction before the end of the body, and truncation on plainText says the same about the words.

availability is the same set the tool surface reports — Readable, EncryptedNotReadableLocally, NotStoredExceededSizeLimit, and NotStoredAwaitingStorageHeadroom — and document is null for every value but the first, because there was no body to reduce.

Parameter Accepts Default
storedEmailId The message's identifier, as a list row or a conversation published it required, in the path
remoteImages true to fetch what the message asks for from other servers on this read alone false
fullHtml true to also answer with the sender's own markup, self-contained false

A message this user does not hold is answered 404, and so is one no deployment ever held, and so is one whose stored content is missing or damaged: nothing in the answer separates somebody else's mail from mail that never existed or from this deployment's own defect. Text that is not a UUID matches no route and is the same 404. A credential whose grant does not carry mailfathom.mail.read is answered 403, as everywhere else on this surface.

The body is served from the local copy. Nothing here contacts a mail server, so no screen waits on IMAP, and opening a message cannot set the remote \Seen flag. The words and the document both pass the same sensitive-content egress guard the tool surface's readings pass, so a redaction rule configured for this deployment applies to what a pane draws exactly as it applies to what a model reads.

The mail document holds the reasoning for every paragraph above, and states what a client is left to render.

The cleaned message body route

GET /api/client/messages/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90/body/cleaned

It answers the same message as the third rendering: the document above with the blocks a model decided were the sender's frame rather than their message absent, and every block it keeps identical to what the body route already served.

{
  "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
  "cleaning": "Cleaned",
  "document": {
    "schemaVersion": 1,
    "refusal": "None",
    "removedRemoteReferenceCount": 2,
    "retainedRemoteImageCount": 0,
    "inlineImageCount": 1,
    "undrawnInlineImageCount": 0,
    "truncated": false,
    "blocks": [ /* the blocks the cleaning kept, in the order they were in */ ]
  }
}

cleaning says what happened, and document is what to draw whichever value it carries.

Value What it means
Cleaned A model answered, the answer described the document, and document is the rendering
NothingToClean There was nothing to clean: no document, a reduction that refused the body, or a document of no blocks
NotActivated This deployment declares no chat endpoint, so it cleans no bodies
AllowanceExhausted The period's MailAnswering ceilings are spent, so nothing was asked of the provider
ProviderUnavailable The provider was asked and did not answer
AnswerRejected Two answers arrived and neither described the document

A route of its own rather than a query on the body route, because what it costs is different in kind. The body route reads a local copy and is published under mailfathom.mail.read; this one sends an outline to a chat provider and is charged to the period allowance a question is charged to, so it is published under mailfathom.assistant.use — a reading grant is not a way to spend a deployment's provider budget. A caller holds both, the read behind this needing the reading grant as every read does.

It never answers an empty pane, and it never fails the read to report a cost. A spent allowance is 200 with the ordinary reduced document and AllowanceExhausted beside it rather than 429: the message is on the screen either way, and taking it away to report a cost would be the worse answer. That is the difference from the reply drafting routes, where somebody pressed a button and has nothing at all unless the call is made.

The model is sent an outline and answers in block indices. What leaves the deployment is each block's kind, its link count and the opening of its text, beside the envelope sender and the subject — never the source markup and never the message whole — and what comes back is ranges of block indices. An answer whose ranges overlap, leave a gap, reach past the last block, arrive renumbered, or carry any message text is refused; the body is put once more and a second refusal answers AnswerRejected. That is what makes the rendering incapable of rewriting a word.

It is asked per open and remembered nowhere. Nothing is derived when a message arrives, nothing is stored, and opening the message again asks again — which is why the reader's own answer about remote pictures travels here too: a cleaning composed out of a different read would disagree with the body on their screen about what the message asked to fetch.

Parameter Accepts Default
storedEmailId The message's identifier, as a list row or a conversation published it required, in the path
remoteImages true where the body on the reader's screen was read with the sender's pictures false

A message this user does not hold is answered 404, under the same rule the body route states, and a credential whose grant does not carry mailfathom.assistant.use is answered 403. Nothing here contacts a mail server, so no screen waits on IMAP and no read can set the remote \Seen flag.

AI configuration § Cleaning a message body holds what an declared chat endpoint turns this on, which model the decision is routed to, and what it spends.

The attachment route

GET /api/client/messages/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90/attachments/0

It answers with one file's octets and nothing else:

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 2401337
Content-Disposition: attachment; filename=release-notes.pdf
X-Content-Type-Options: nosniff
Cache-Control: no-store

position is the place the file holds in the message route's attachments list, which is the order the message's structure is walked. A position that list does not have is answered 404, as is a negative one, and neither reads the mailbox to find out.

The three headers are the sender's own values, encoded for where they are being written. The media type is parsed before it is echoed, so a header value the sender wrote cannot introduce a parameter or a second header, and a value that is not a media type at all is served as application/octet-stream rather than repaired into something plausible. The file name is written through RFC 5987 encoding rather than concatenated into a header. Content-Length is the size the parse measured — the same number the message route published — so a client knows what to expect and a transfer cut short is visible as one rather than as a shorter file.

The disposition is always attachment and nosniff is always set. These are bytes a sender chose, served from the origin the client itself is served from: rendered in place, a message carrying HTML would be a scripted page on the address the operator publishes MailFathom at. no-store is there because this is an ordinary cacheable GET whose response is mail content, and the deployments this surface is documented for put a reverse proxy in front of it.

The octets are streamed rather than buffered, decoded from the stored copy straight into the response, so a large attachment costs the copy buffer rather than its own size on either side — on a deployment that screens nothing. Where screening is on the file is read whole before a byte leaves, because every parser behind the extraction seeks, so a 16 MiB attachment costs its own size for the length of one extraction and the claim above describes the answer rather than the whole request.

It is the client's own route rather than the signed link the tool surface mints, and the difference is who is being served. A download link exists to be handed to something holding no credential, which is why it is a bearer capability that expires within minutes; a reader here has already authenticated and holds mailfathom.mail.read, so the credential they presented is the access control and nothing is minted. That is also what keeps this working on a deployment serving no MCP endpoint, which serves no link route either.

A file of a message this user does not hold is answered 404, and so is one of a message no deployment ever held, and so is one whose stored content is missing or damaged: nothing in the answer separates somebody else's mail from mail that never existed or from this deployment's own defect. A credential whose grant does not carry mailfathom.mail.read is answered 403, as everywhere else on this surface.

It is served from the local copy. Nothing here contacts a mail server, so downloading a file cannot fetch a message and cannot set the remote \Seen flag.

A screened deployment reads the file before it streams it. Where sensitive-content scanning is switched on for this user, the document's own text is extracted and scanned, and the route answers 409 with errorCode 59004 rather than the octets when a scanner names something in it — and equally when nothing could read the file at all, since an attachment that was not read is never treated as clean. The answer names no scanner, no category, and nothing about the file, and it is deliberately a different status from the 404 above: this reader is already authenticated for this message and this position, so what they learn is that the deployment screens what it serves rather than anything about mail they may not read. Nothing is redacted — a file is served whole or refused — and a user who screens nothing pays no extraction and reads exactly the answer the paragraphs above describe.

The citation route

POST /api/client/citations/resolution
Content-Type: application/json

{
  "citations": [
    { "kind": "fragment", "email": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90", "fragment": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91" },
    { "kind": "attachment", "email": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90", "attachmentPosition": 1 },
    { "kind": "email", "email": "0198f4c2-7d8e-7b2f-a041-52c637d8e9fa" }
  ]
}

It answers with one resolution per citation, in the order the request named them:

{
  "citations": [
    {
      "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "outcome": "Resolved",
      "message": {
        "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
        "account": "primary",
        "folder": "INBOX",
        "subject": "Renewal terms",
        "sentAt": "2026-03-04T09:00:00+00:00",
        "receivedAt": "2026-03-04T09:01:12+00:00"
      },
      "fragment": {
        "fragmentId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
        "ordinal": 2,
        "startOffset": 400,
        "endOffset": 423,
        "text": "the agreed rate is 4.5%"
      },
      "attachment": null
    }
  ]
}

A citation is what turns an answer into something checkable. Every material fact a Discover run states carries one, and a citation resolves through this route and no other — so a client draws one evidence affordance whatever block the fact was rendered in.

What it takes is the citation target the plan published, unchanged. The three kinds are email, fragment, and attachment; each names the message it belongs to as email, a fragment citation names its passage as fragment, and an attachment citation names attachmentPosition — the same position the attachment route is asked with. A body naming a kind whose members it does not carry, or a kind that is none of the three, is answered 400: it is a document no plan ever declared rather than a citation that failed to resolve.

outcome is one of three, and two of them are states rather than errors. Resolved means the citation was followed to the place it names. Unresolvable means the place is no longer there — the message re-chunked since the plan was composed, or its parts changed — and the resolution still carries the message, so a reader is taken to the correspondence rather than told the fact has no source. PrivateSource means the caller may not read it, and carries nothing but the identity the caller already sent.

Mail this user does not hold and mail belonging to somebody else are both PrivateSource, and nothing in the answer separates them: telling them apart would take a read outside the caller's own scope, and its answer would say whether somebody else's message exists. A local copy that is stored and damaged is Unresolvable instead, carrying no message, which is this deployment's own defect rather than a statement about anyone's mail.

A resolution carries enough to draw the source in place and no more: the passage with the offsets it was cut from, the message it belongs to, and its dates. Reading the rest of the message is the message route, which is a request the reader chose to make, and no octet of a cited file is here — the file is described exactly as the message route describes it.

One request follows at most ten citations, which is also what bounds the messages read, and a passage is bounded before it is ever cited because chunking cuts it to a fixed length. A larger batch is answered 400, a body over 16 KiB is answered 413 before the route is reached, and a credential whose grant does not carry mailfathom.mail.read is answered 403.

It is a POST that changes nothing. What it takes is a list of small documents rather than a value, and a request line of them would be the plan's own JSON encoded into a URL under a length Kestrel refuses before a handler is reached. It is served from the local copy, so following a citation contacts no mail server and cannot set the remote \Seen flag.

The mutation routes

These eight are how a person changes the mailbox itself: marking mail read or unread, starring it, relabelling it, filing it into another folder, and deleting it off the server — and asking where each of those changes has got to, taking one back, or saying a delete need wait no longer.

Route What it does
POST /api/client/mutations/flags Writes down one batch of flag and tag changes, one result per message
POST /api/client/mutations/moves Writes down one batch of folder moves, one result per message
POST /api/client/mutations/deletes Writes down one batch of deletes, one result per message
GET /api/client/mutations?record=…&record=… Reports where each of the caller's own changes stands
POST /api/client/mutations/flags/withdrawals Takes back flag and tag changes nothing has been asked of a server for
POST /api/client/mutations/moves/withdrawals Takes back moves nothing has been asked of a server for
POST /api/client/mutations/deletes/withdrawals Takes back deletes that are still waiting
POST /api/client/mutations/deletes/releases Ends the wait in front of deletes, so they are taken in hand at once

Nothing here reaches a mail server, and that is the design rather than a limitation. A submission writes a durable record and answers; the account's own reconciliation pass is what issues the IMAP command, which is ADR 0007's write session and the same path a rule, a spam verdict, and an MCP tool go down. So a screen never waits on somebody else's mail server to redraw, a change asked for while the account is unreachable is kept rather than lost, and a process that dies between a copy and a delete leaves a record saying what was half done.

The pass is brought forward rather than waited for. A record written here ends the account's wait between synchronization runs, so the change is issued on the run that follows within seconds instead of at the next interval. Push does not cover this: what a watched folder reports is the mail server changing, and a change authored here is not that. Nothing about correctness turns on it — the account's own schedule reaches the record either way, which is why a raise that is lost delays a change rather than dropping one — and it is what keeps a deleted message from sitting under moving to trash for minutes.

A submission is a batch, and the answer is per message. At most 200 messages per request — and at most 100 records per read, because a read names them in the request line. The route enforces that hundred itself, answering a longer one with an ordinary 400; it is set well under the request line Kestrel will actually accept, so a longer path or a proxy that rewrites the prefix never turns a documented read into a raw 414 nobody can act on. A refusal about one of the messages is that message's own result rather than the request's — so a batch composed from a list that has moved on since the screen drew it reports exactly which entries did not apply and writes the rest down. requestId is the caller's own identity for the request: repeating a request under the same one is the same request and produces the same records rather than a second set, and omitting it has one generated, which makes every submission distinct.

POST /api/client/mutations/flags
Content-Type: application/json

{
  "requestId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
  "changes": [
    {
      "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "flags": { "seen": true, "flagged": null },
      "tags": { "change": "add", "keywords": ["$Todo"] }
    }
  ]
}
{
  "results": [
    {
      "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "outcome": "recorded",
      "detail": null,
      "changes": [
        { "mutation": "set-seen", "recordId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91", "state": "pending" },
        { "mutation": "add-keywords", "recordId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a92", "state": "pending" }
      ]
    }
  ]
}

A record per value rather than per message, because a record is the unit convergence resumes, abandons, and attributes an observation back to. A message whose \Seen change completes while its keywords are still converging reports exactly that.

flags and tags are two different things and the response keeps them apart. flags are the IMAP system flags \Seen and \Flagged; tags are IMAP keywords, which is what a mail server calls a label. Both reach the mailbox — MailFathom holds no tag of its own, so there is no local label that could leak to a server by being confused with a keyword, and equally none to keep private. A tag change names both halves together, change being one of add, remove, or replace and keywords the list it applies to: a list without a direction and a direction without a list are each half a change, and guessing which was meant would make clearing every tag unreachable and an accidental empty list destructive.

Nothing on this surface sets \Seen implicitly. Reading a message does not mark it read anywhere — not the message route, not the body route, not the attachment route. Marking a message read is a flag change submitted here and nothing else. What MailFathom's own client does with that is ADR 0026's answer rather than this route's: a person opening a message has the client submit one change here, unless they turned markReadOnOpen off or the credential was never granted mailfathom.mail.flags.write.

A move names the folder by its alias, exactly as the folders route publishes it, rather than by its place on the server: an alias keeps its meaning when the server renames or recreates the folder behind it.

POST /api/client/mutations/moves
Content-Type: application/json

{ "moves": [{ "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90", "destinationFolder": "ARCHIVE" }] }

Each result carries one of recorded, applied, message-not-found, destination-not-found, destination-not-allowed, already-in-destination, or account-no-longer-configured, and a flag change may also answer change-not-usable when the values asked for are not values one request can name. A folder withheld from this caller is reported as a destination that is not there, on the same rule that makes mail in a withheld folder a message that is not there: filing mail into a folder the caller cannot read would move it out of sight rather than be a capability of its own.

The drafts folder is kept to drafts. A draft is a message standing in the folder the account's Drafts role names; nothing else identifies one, because a draft reaches the mailbox from other clients that set no flag MailFathom could rely on. A move of anything else into the drafts folder is destination-not-allowed, and so is a move of a draft into any folder that carries a role other than the trash: a draft is filed only into a folder with no role — one a person made — or into the trash, which is how it is deleted.

On an account whose mailbox MailFathom holds, a change is made rather than recorded. There is no server to carry it to, so a flag, a keyword, a move, or a delete on a held account is committed to the stored message in the same transaction as its audit entry where the account keeps one, the answer is applied, and changes is empty because no record exists to follow. Treat an applied result carrying no change as finished: nothing converges afterwards and no later state will be reported. requestId matches a repeat only against a record, so a submission repeated on a held account applies its changes again. A move files into the local folder the destination's role names, or into the local folder the destination's source folder created; a destination with neither is destination-not-found, and a message already in that local folder is already-in-destination. A delete moves the message into the local trash, which a person can move it back out of. A delete of a message already in the trash is the one act still recorded: it erases the message and everything derived from it, so it is held for the same window as every other delete and can be withdrawn through the same route until the window passes. This surface names no copy at all, on a held account or any other: a rule is the only thing here that copies a message, and what it produces on a held account is a second stored message rather than a record this route would have to report on.

While the mailbox is being appended back to its source, a change is both made and recorded. An account in the Restoring phase is still the truth about its own mail, so every act is committed exactly as it is on a held account and the answer is applied for the same reason. What differs is what comes with it: where the message still stands on the source — never drained, or already appended back by the restore — the same transaction opens the ordinary record that carries the act to the server, and the answer names it where it names a record at all: changes on the flags route, which reports one entry per value, and the single change on the move and the delete routes. So applied there means the mail has changed and a record may still be converging, which is what keeps a message acted on during the restore from arriving back in the state the source last had; a message the drain has already taken off the source carries no record and is answered as a held account's act is, the restore writing the act onto it when it appends the message. A delete answered applied on such an account moves the message into the local trash and records the delete the source has not heard about; the erasure a second delete asks for is recorded and reaches no server, exactly as on a held account.

The record beside an applied change is not one a withdrawal takes back, which is the one thing a client has to treat differently about it. withdrawal_window_seconds buys the stretch in which a change that has only been recorded may still be stopped, and a change answered applied has already happened to the stored message — so the record carrying it to the source is opened with no window at all, and the withdrawal routes leave it exactly where it stands and answer it pending rather than cancelled. The answer is what says which case a client is in: an undo affordance belongs to recorded, and applied is the same finished act on a restoring account that it is on a held one, with the record reported beside it so the caller can watch the source catch up rather than so it can change its mind.

Moving mail is its own grant. mailfathom.mail.flags.write does not reach it and mailfathom.mail.move does. A flag misdescribes mail the user can still find; a move puts the mail somewhere else, and on a server without MOVE it is a copy followed by a delete — which is why the two are granted separately and why the record exists at all.

A delete names a message and nothing else, because there is no destination to name: it asks the account's pass to expunge that occurrence from the server, and what becomes of the local copy is the account's configured disposition rather than anything a caller writes.

POST /api/client/mutations/deletes
Content-Type: application/json

{ "deletes": [{ "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90" }] }

Each result carries recorded, applied, message-not-found, or account-no-longer-configured. There is no destination-not-found here for the same reason there is no destination, and a message already gone is reported as one that is not there rather than as a delete that succeeded twice.

Deleting mail is its own grant again. mailfathom.mail.move does not reach it and mailfathom.mail.delete does: a move the user did not want is undone by moving the mail back, while this is the act that means the mail stops existing on the server, so a deployment that lets a client file mail has not thereby let it destroy any. Which folder the message is in decides nothing on this surface: the rule that MailFathom's own client offers this only for mail already in the trash is that client's sentence to its reader, and the grant is the whole of what this route enforces.

A delete written here waits before anything is asked of the mail server, and can be taken back while it does. Every record a batch writes is held for the signed-in person's own notificationSeconds plus ten seconds, read once for the whole batch so a selection deleted as one act can be taken back as one. The account's pass does not see a held record, so for that long POST /api/client/mutations/deletes/withdrawals cancels it exactly as the other two withdrawal routes cancel theirs, and under mailfathom.mail.delete, the grant that wrote it. The ten seconds are for a client that never gets to say it has stopped offering the way back — a tab closed, a network gone, a machine put to sleep — so that a delete does not reach the server while the offer is still on somebody's screen. The confirmation a client asks in front of the act stays: it is answered before anybody has seen what happened, and the wait adds the seconds in which they still can.

A client that has stopped offering the way back says so, and the wait ends. POST /api/client/mutations/deletes/releases names records exactly as a withdrawal does, takes each one in hand at once, and answers with each record as it now stands. Nothing depends on it being called: a window elapses on its own and the record is taken in hand exactly as if it had been, so a client that never asks costs the mailbox a wait rather than a delete. Asking twice, or after the window has passed, is the same as asking once, and a record already withdrawn is reported cancelled rather than revived.

A delete written anywhere else does not wait. A rule, a spam verdict, and an MCP tool write theirs with no window, because nobody is looking at a notification that could take one back.

A move either completes or leaves the message where it was, and a half-finished one is reported rather than guessed at. The read route's outcomeUnknown is that report: a placement command went out and its answer never came back, so the message may be in the destination, in the source, or in both, and MailFathom will not decide which. The account's next pass re-establishes it; until then the field is the one thing on this response a person acts on rather than waits through.

GET /api/client/mutations?record=0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91
{
  "changes": [
    {
      "recordId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
      "storedEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "mutation": "relocate",
      "state": "converging",
      "outcomeUnknown": false,
      "attemptCount": 2,
      "lastFailure": 22001,
      "recordedAt": "2026-08-12T09:00:00+00:00",
      "stateChangedAt": "2026-08-12T09:04:00+00:00"
    }
  ]
}

state is pending, converging, completed, dead-lettered, or cancelled, and attemptCount with lastFailure are what say a change against an unreachable account is being retried rather than forgotten. The retries are bounded and backed off by the account's own pass; a change that exhausts them is dead-lettered, which is a person's to look at rather than something the deployment keeps trying forever.

A change that has not reached the server is withdrawable, and one that has is not. A withdrawal moves a record to cancelled, and the account's pass never sees it. A record past the point a command went out is reported where it stands instead of being refused, which is also what makes the call safe to repeat: a STORE already issued cannot be recalled, and a placement whose answer never came back has to be re-established rather than declared void. The grant that authored a change is the grant that withdraws it, which is why there are three withdrawal routes rather than one.

A record belonging to somebody else is absent from every answer here rather than refused, and so is one recorded in a folder this caller may no longer read — the same answer a read of that folder's mail gives. Nothing on this surface says whether an identity somebody else holds exists.

No mutation record carries mail content. A record names the message, the change, the folder, and where it stands; no subject, no correspondent, no body, and no keyword reaches a log line or a telemetry dimension from it.

The record routes

These six are how a person maintains what this deployment reads for them: which folders of each mailbox assigned to them it reads, and the settings that are theirs rather than the deployment's. Reading is mailfathom.mail.read like the rest of this surface; the four writes are mailfathom.mail.accounts.write, separately granted for the reason every write here is separately granted — reading somebody's mail is not deciding what is read out of their mailboxes.

Which mailboxes a person has is not decided here. A mailbox is declared, assigned to somebody, and withdrawn through the administrative endpoint alone, so no route on this surface creates one or ends an assignment to one.

Route What it does
GET /api/client/record Hands over the signed-in user's record as redacted JSON, with the version it was read at and each of its settings as the settings policies governing them resolve it
POST /api/client/record Commits that record back edited, as one change against the version it was opened over
GET /api/client/record/mail-accounts Hands over each mailbox assigned to the signed-in user as the settings policies governing it resolve it
POST /api/client/record/mail-accounts/folders Declares one more folder in one of those mailboxes
POST /api/client/record/mail-accounts/folders/replacement States one folder afresh, in place of the one carrying an alias
POST /api/client/record/mail-accounts/folders/removal Stops the mailbox declaring one folder, named by its alias

The record read answers what the person stated and, beside it, what they are served. document is the record's own: what somebody wrote on it, which is what a save is composed over. A settings policy of the deployment or of the person's organization may force a value over the record's or supply one the record leaves out, and neither is ever written into the document, so properties carries one entry per setting of the record with the value in force:

{
  "user": "3f1d2c4e-…",
  "displayName": "Ada Lovelace",
  "version": 7,
  "document": "{\"Language\":\"English\",\"TimeZone\":\"Europe/London\"}",
  "properties": [
    { "path": "ClientTelemetryLevel", "value": null, "source": "BuiltIn", "heldBy": null, "changeable": false },
    { "path": "DisplayName", "value": "Ada Lovelace", "source": "Record", "heldBy": null, "changeable": true },
    { "path": "EndpointAccess:ClientEndpoint", "value": true, "source": "BuiltIn", "heldBy": null, "changeable": false },
    { "path": "EndpointAccess:McpEndpoint", "value": true, "source": "BuiltIn", "heldBy": null, "changeable": false },
    { "path": "Language", "value": "English", "source": "Record", "heldBy": null, "changeable": true },
    { "path": "Portrait", "value": null, "source": "Record", "heldBy": null, "changeable": true },
    { "path": "TimeZone", "value": "Europe/Warsaw", "source": "OrganizationForced", "heldBy": "Organization", "changeable": false }
  ],
  "unresolved": null
}
Field What it says
path The setting, as the colon-separated path a policy and a configuration key name it by
value The value the person is served with, or null where nothing states one and the build takes none either. DisplayName is the name the person is recorded under: a column beside the record rather than a key of its document, written through the name routes, of which a policy says only who may change it
source Which step of the resolution order supplied the value: DeploymentForced, OrganizationForced, Record, OrganizationDefault, DeploymentDefault, or BuiltIn
heldBy Deployment or Organization where that scope's policy forces the setting or does not leave it to the person to change, and null where no policy holds it. A force is named before a restriction
changeable Whether a change to the setting from this caller would be accepted on this surface: false where a policy holds it, for the two settings only an administrator writes, EndpointAccess and ClientTelemetryLevel, and for everything but TimeZone and Portrait where the caller's grant does not carry mailfathom.mail.accounts.write — those two are written through routes of their own that the grant reading the record already reaches

unresolved is null wherever the settings were resolved. Where a policy governing the person is one this replica's build does not read as a settings policy, properties is empty and unresolved carries the sentence naming which scope's policy it is — the replica does not serve that person's record on part of what governs it, and says so rather than answering an empty list as no settings.

A save may not move a setting that is held against the person, and it may carry one through. Three things hold a setting against whoever is saving their own record: a policy forces its value, a policy's editing restriction does not leave it to the person, or it is one of the two settings only an administrator writes — which endpoints a person is served on, and the level their client is asked to record at. A saved record moving such a setting is refused in a sentence naming the setting and who holds it:

TimeZone is held by the organization, whose settings policy forces its value, so nothing written on the record changes it. Leave it as the record states it, or change the policy.

A record that carries a held setting through passes, and carried through means stated as a read showed it: unchanged from the record's own value, or as the value properties answers for it. The second passes without being written, so the record's own value stays exactly as it was and is what comes back once the force is lifted. A save that names nothing but held settings carried through commits nothing and answers the version already in force.

Language is required of a saved record only where no policy supplies it. A record whose organization or deployment states a default or a forced language may leave it out, and is refused for leaving it out everywhere else.

A person's mailboxes are read the same way, on a route of their own. A settings policy governs a mail account as it governs a record — how a settings policy resolves a mail account holds the order, what a list is, and which properties take no value from a policy — and GET /api/client/record/mail-accounts answers what that leaves each of the caller's mailboxes served:

{
  "accounts": [
    {
      "id": "5b0c8a3e-…",
      "properties": [
        { "path": "DisplayName", "value": "Work", "source": "Record", "heldBy": null, "changeable": false },
        { "path": "Folders", "value": [ { "Alias": "INBOX", "RemotePath": "INBOX" } ], "source": "OrganizationDefault", "heldBy": null, "changeable": true },
        { "path": "Host", "value": "imap.corp.example.test", "source": "OrganizationForced", "heldBy": "Organization", "changeable": false },
        { "path": "Secrets:Password", "value": null, "source": "Record", "heldBy": null, "changeable": false }
      ],
      "unresolved": null
    }
  ]
}

accounts carries one entry per mailbox assigned to the caller, in identifier order, each properties list in the shape the record read answers and listing every setting of the mailbox — the example shows four. Two things are particular to it:

  • changeable is true for Folders at most. The folder routes are the only routes of the person's that write a mailbox, so the list of folders is the one setting of it that can be theirs, and it is where no policy forces it or withholds it and the caller's grant carries mailfathom.mail.accounts.write.
  • No secret travels on this route. A secret block is listed with a null value whatever the mailbox states for it, and the route answers nothing of a mailbox beyond the settings a declaration states: no synchronization state, and no mail.

Where a policy governing a mailbox is one this replica's build does not read, that entry's properties is empty and its unresolved carries the sentence naming which scope's policy it is. A caller whose row has gone is answered 404, as on the record read. The accounts route stays what a client renders its mailbox list from: it answers each mailbox's two names and how fresh its copy is, and nothing a policy decides.

The three folder routes refuse a list of folders held against the person. They change the list of folders and nothing else, so each is refused in a sentence naming the setting and who holds it where a policy forces Folders or its editing restriction withholds it. What these routes fix for every folder — that it is synchronized, and that one naming a RemotePath is created where it is missing — is unchanged by any policy.

Folders is held by the organization, whose settings policy does not leave it to you to change. Leave it as it stands, or ask whoever administers the organization.

A folder change is composed over the folders the mailbox is served. A list is one value across a policy's layers, so a mailbox that states no folders and is served a default's has that whole list to change one folder of: the first folder added, restated, or withdrawn writes the resulting list onto the mailbox, which from then on states its own and no longer follows the default.

The three folder routes are the whole of what a client may do to a folder, and none of them touches a mail server. Each is a change to the mapping the record declares: a declaration adds one and lets the account's next run create the folder its own configuration names, a replacement states that mapping afresh in the position the old one held, and a removal takes the mapping out. Renaming, deleting, subscribing, and unsubscribing a folder on the server are refused outright by ADR 0007, which is why a removal here stops the deployment reading a folder rather than removing one — the mail already stored stays where it is, and so does the folder on the server. That is unlike an administrator ending the last assignment to a whole mailbox, which erases its stored mail. A removal withdraws only the alias it names: a folder sitting beneath it stays declared and is read as a folder of its own from then on.

Each of the three takes the account by the identifier the deployment generated for it — the one the account list the client is served names — the folder as the JSON a configuration file would state it in, and the version the record was read at. Every account write answers with the version of the signed-in user's record, which every such write moves. The declaration is bound and validated exactly as a configuration file's is, so an alias that is not a valid one, a remote path that is not a path, and a record another writer moved on in the meantime are each refused with the sentence saying what to correct — as is a replacement or a removal naming an alias the account does not declare.

Part of a folder declaration is the service's rather than the person's, and stating it otherwise is refused rather than quietly overwritten. A folder declared on this surface is always synchronized, so Synchronize is written as true whatever the request left out, and a request stating it as anything but that value is refused naming the switch. A declaration is the object a configuration file would state the folder in, so the value is read the way a configuration file's is: the JSON boolean true and the string "true" are one answer, and anything else in either spelling is the refusal. A folder naming a RemotePath also carries CreateIfMissing as true, so a folder a dialog declares is created where the server advertises none at that path; a folder found instead by the role it plays carries no such switch, because a folder that does not exist advertises no role, and a request stating one on such a folder is refused naming RemotePath. GenerateEmbeddings, VisibleToTools, and RemotePath stay the person's on every folder, special ones included — which is what lets a folder declared against the wrong place on the server be corrected rather than started over. The record route carries no mailbox at all and is therefore no way around them.

A folder's role is stated when the folder is declared and never afterwards, and the folder playing one stays. The folder carrying a SpecialUse is named after the role it plays — Inbox, Drafts, Sent, Junk, Trash, and the rest of the roles a folder may be given — so a declaration naming a role under any other alias is refused. Through the folder routes a replacement may not withdraw a role, swap one for another, or give one to a folder declared without it, and a removal may not withdraw the folder playing a role at all: filing needs its drafts and sent folders, and a mailbox with two inboxes has no inbox. An account holds at most one folder per role either way, which is the rule a configuration file is bound by as well. Whoever administers the deployment states a whole account rather than an act against one, so none of this binds the administrative surface or an operator's own configuration.

No route here names a user, and that is the whole of the isolation. The record acted on is the one belonging to the credential that authenticated, resolved from the request rather than read out of the body or the path, so there is no identifier a client could put in a request to reach somebody else's record. It follows that a request naming another user cannot be composed at all — there is nowhere to put the name — and a deployment serving several people publishes no route through which any of them learns that the others exist. The administrative surface is where a roster is read, and it is not reachable with a credential issued for this one.

Nothing here reports a secret, and nothing here can overwrite one blindly. A record is handed over with every password, token, and client secret replaced by the redaction marker; a save is read as the difference from what the row holds, so a marker saved back leaves the credential beneath it as it was, and a marker this deployment cannot place is refused rather than committed over somebody's password. Material supplied here is sealed under the deployment's data-encryption key like every other MailFathom secret, and what the record keeps is the reference to it.

A candidate is validated before it is committed, and committed whole or not at all. It is bound strictly against the same rules a configuration file is, composed with every account assigned to this user, and put through the same mail-synchronization validators a start applies — including the walk that resolves every credential the record names. A save of the record itself never touches an account, so a reference that stopped resolving in one of this user's accounts is reported beside the commit rather than refusing it, and is worth clearing before the next restart, which refuses a record carrying it. What each composed account asks about scanning the mail in it is judged here too: an account may switch a scanner on for its own mail and never off, and asking for the personal-data scanner where the deployment stood no analyzer up is refused at the write rather than left to fail closed on the next message. A refusal names what to correct — for a scanning one, the deployment setting behind it — and carries nothing that was supplied as a secret. A record another writer moved on in the meantime — the user from a second device, or an administrator — is refused as superseded rather than overwritten, so the client re-reads and composes the change again.

No write here states a mailbox's credential. A mailbox's server, login, and the reference to its password are part of its declaration, which whoever administers the deployment states with mfctl account add and mfctl account edit. The folder routes write the list of folders and nothing else, and the record route carries no mailbox, so mailfathom.mail.accounts.write reaches no secret this deployment can resolve.

A user whose mail accounts are still read from this deployment's configuration cannot write here. The write is refused, naming the declaration as where those mailboxes are changed, because committing it would leave two answers to which mailboxes this deployment reads and the files would win at the next restart. Nothing on this surface changes that: which decisions a deployment's own files make is the operator's, not the user's.

An accepted record change reaches the running process. A folder declared here is stored and read by the account's next run without a restart. The coordinator drains work already in flight against the immutable document version it began with, then starts the replacement supervisor, so one run never reads two answers.

The name routes

These two are how a client draws the person signed in. Until they existed it held a finished credential and nothing the person is called, so the account menu and the Settings screen had an anonymous icon where a name belongs.

Route What it does
GET /api/client/display-name Hands over the name this deployment records the signed-in person under, and says whether it would accept a change of it
POST /api/client/display-name Records them under the name they corrected theirs to
{ "displayName": "Ada Lovelace", "changeable": true }

The name is the envelope rather than the record. It is the same label mfctl user list shows and the record routes do not serve: a column beside the document, unique across the deployment, that nothing resolves anybody by. A client reading the record alone would still have nothing to draw a person with, which is why this is a route of its own rather than a key in that document.

The read says whether the write would be accepted, so the client never has to find out by trying. changeable is false for somebody whose credential was not granted mailfathom.profile.write, and for somebody whose organization's or deployment's settings policy does not leave DisplayName to them to change. It reports the answer rather than the reason: a client draws the same read-only field however the write would be refused, and naming the grant a credential lacks would report a deployment's own decisions back to a page holding a token.

A name a policy holds is refused naming who holds it, and the name already held passes. The write of a different name is answered 400 with the sentence saying whether the organization or the deployment holds it; a request stating the name the person is already recorded under changes nothing and is answered with that name and "changeable": false. An administrator's relabel is not bound, because an editing restriction binds the person alone and a policy never forces a name.

The person that section supplies is refused, and told who to ask. Their record is the operator's rather than theirs — the deployment states their mailboxes and MailFathom keeps the row — so the name on it is the operator's to set. What comes back names whoever administers the deployment.

The name is bound exactly as the envelope binds it. Blank is refused, so is anything past 128 characters, and so is a name somebody else on this deployment already carries — each naming what to correct. Surrounding white space is trimmed, and the answer carries the name as it was stored rather than as it was sent. The body is bounded like every other on this surface, and one past the bound is answered 413.

It carries no version. The version the record's writes state guards the document a change was composed over, and the name is not part of that document, so nothing here is refused as superseded.

Neither route names a user, exactly as no record route does: the name read and written is that of the credential that authenticated, resolved from the request rather than out of the body or the path. Neither adds a name to the published permission set.

Reading is mailfathom.profile.read and writing is mailfathom.profile.write. Neither is a grant over mail, because what a person is called is not mail, and the write is deliberately not mailfathom.mail.accounts.write: that grant decides what this deployment reads out of somebody's mailboxes, so somebody whose mail configuration an administrator maintains in full does not hold it and still corrects their own name. What keeps a name from being changed where it should not be is not the grant — it is the configuration source that declares the person and the settings policy that holds the setting, both above.

The time zone a person's days are read in

These two are how a client learns which zone to draw a date in, and how a person corrects it. The value decides two things rather than one: what every date on the screen is written in, and what this deployment resolves a relative period against when it reads a search sentence, drafts an event out of a typed description, or answers a question about a stretch of mail.

Route What it does
GET /api/client/time-zone Hands over the zone this deployment reads the signed-in person's days in, and says whether that is still the default
POST /api/client/time-zone Records the zone they stated theirs is
{ "timeZone": "Europe/Warsaw", "isDefault": false }

The zone is read here rather than sent with every request. An operation resolving this week on somebody's behalf runs where the mail is, so the anchor it states has to be a value this deployment holds — an MCP caller asking ask_mail sends no browser and no clock, and a client that sent one would be a second answer to a question the record has already settled. TimeZone in the user record is where it lives, read as the settings policies governing the person resolve it: a zone a policy forces is the zone answered whatever the record states, and a policy's default is the zone of a record stating none. A record no policy supplies a zone for, stating none itself, is read in UTC.

A zone a policy holds is refused naming who holds it. Where the organization or the deployment forces the zone, or does not leave it to the person to change, a write naming another zone is answered 400 with the sentence saying which of the two holds it, and nothing is written. A write naming the zone in force passes and writes nothing, and so does one naming the zone the record itself already states beneath a force — and the answer to that one carries the zone the person is read in, which is the forced one, never the one they named. A policy this replica's build does not read holds the whole record, so a write under it is answered 400 with the sentence naming that policy.

isDefault is stated rather than left to be inferred, and it says whether anything states a zone at all — the record or a policy above it, not whether the answer reads as UTC. What it decides is whether a client may propose the zone the browser reports for somebody who has never been asked, and a client comparing the identifier against UTC instead would propose over somebody who chose the coordinated zone deliberately. So a record stating nothing is answered "UTC" with "isDefault": true, and a person who chose UTC is answered the same identifier with "isDefault": false. The write answers false whichever zone was named, the record stating one from that moment.

The identifier is an IANA zone name this deployment knows, such as Europe/Warsaw, at most 64 characters. A name no zone database here carries, and an offset such as +02:00, are refused with 400 naming the form it takes — because a value quietly read as UTC would place every date and every relative period a day out with nothing having said so. The body is bounded like every other on this surface, and one past the bound is answered 413.

Neither route names a user, exactly as no record route does: the zone read and written is that of the credential that authenticated. A deployment holding no record for that person answers the write 404. A write naming the zone the record already states is answered as a write that landed and commits nothing: the record's version is what every replica recomposes that person on, which is a cost to pay for a change rather than for a re-submitted choice.

Reading is mailfathom.profile.read and writing is mailfathom.profile.write, for the reason the portrait routes are: which zone somebody's own days are read in is not a decision about what this deployment reads out of their mailboxes, so gating it on the record's own write would refuse a change about nothing but themselves to somebody whose mail configuration an administrator maintains in full.

The preferences routes

These two hold what a person set about their own client, so that it follows them rather than the machine they set it on. Somebody who turns telemetry off on their laptop has not agreed to anything on the next machine they sign in from, and somebody who set the client up the way they work should not have to set it up again per browser profile.

Route What it does
GET /api/client/preferences Hands over the signed-in person's preferences, with every one they never set answered by its default
POST /api/client/preferences Replaces all of them, as one document
{
  "telemetryEnabled": true,
  "theme": "system",
  "openMailInTabs": false,
  "markReadOnOpen": true,
  "expandWholeThread": false,
  "messageView": "reduced",
  "aiFiltersShown": true,
  "notificationSeconds": 5,
  "telemetryHeldBy": null
}

It holds eight preferences and nothing else. The ninth field of an answer, telemetryHeldBy, is not one: it says who holds the first, as described below, and a write does not state it. Whether this deployment may be told what the person's client is doing; what the client is painted in, which is system, light, or dark; whether opening a message opens a tab rather than replacing what is on the screen; whether opening a message marks it read on the person's own mail server; whether opening a conversation draws every message in it rather than the one it was opened at; which of the three renderings an open message is drawn as, which is reduced, cleaned, or embeddedHtml; whether the client offers the standing views of the mailbox beneath its folder tree; and how long one of the client's own notifications stands before it takes itself away. Each of them says how somebody wants to work, which is why it belongs to the person. The language does not, and stays on the device: it is resolved for somebody who has not signed in and may never get a session. Neither does the width a person drags the message list to, which describes the screen in front of them.

Unset reads as telemetry on, the theme following the machine, tabs off, marking read on, a conversation opening at the message it was opened at, a message read as the reduced document, the standing views drawn, and a notification standing for five seconds. A person who has set nothing is answered a document rather than a refusal, so a first run draws a screen. The theme is still resolved on the device before sign-in — the client cannot wait on the network to paint itself, and there is no session to read this over above the sign-in screen — and what this answers replaces that device value once a session exists.

markReadOnOpen covers every account that person reads, and turning it off stores no read state instead. It is one value rather than one per mailbox because read state is what must not differ between the machines somebody reads on, and a client whose user has turned it off shows what their mail server last reported and remembers no reading of its own. It governs opening a message and nothing else: marking a message read or unread deliberately, through the flag mutations above, is unaffected by it. ADR 0026 holds the reasoning, including why an operator's lever here is mailfathom.mail.flags.write rather than a key of their own.

expandWholeThread decides how a conversation opens and nothing more. With it unset or off, a conversation opens at the message it was opened at and the messages before it stand behind one control naming how many there are — which is what the client does, and what a reader who came from a search result wants. With it on, the same conversation opens with all of them drawn. It is read when a conversation opens rather than watched while one is on the screen, so moving the switch changes the next conversation rather than the one being read, and the control is still there either way.

messageView decides which of the three renderings an open message is drawn as. It replaces the embeddedHtmlMessages switch that decided between two of them, and a document written under that key reads as reduced rather than being translated: a switch that was on says nothing about which of the two other renderings it now means.

  • reduced, which is what an unset document answers, is the closed document tree ADR 0024 takes. The other two are each one control away — the cleaned one in the settings, the sender's own markup on the message head.
  • cleaned is that same tree with the blocks a model decided were the sender's frame rather than their message absent, and every block it keeps identical to what reduced would have drawn. It is derived per open by the cleaned body route below, which is what makes it the one rendering a reader waits for. A deployment that does not clean bodies, a spent allowance, and an answer that could not be used each serve the ordinary reduced document with the reason named.
  • embeddedHtml draws the sender's own markup inline and takes the control on the message head away, having nowhere left to take anybody. It changes what a read asks for rather than only what is drawn: a client in either of the other two never asks for the self-contained representation, so choosing this is what puts fullHtml=true on the body route. A message whose markup this deployment holds none of, or served cut short, falls back to the reduced tree with the reason named rather than to an empty frame.

The two renderings drawn from the document tree are drawn in the client's own colours. A colour the tree carries was picked by the sender against the white page their composer drew, so reproducing it is how a reading pane ends up with every message in a different colour, each of them legible by luck and several of them invisible under a dark theme. What survives of a sender's own presentation on those two surfaces is their formatting — bold, italic, underline, monospace, a strikethrough, the alignment and the structure — because each of those says something a decorative colour does not. One distinction is kept: a colour a sender used to step back from their own body text draws as the client's own small print, so a disclaimer stays a disclaimer rather than competing with the message above it, and a cell they filled keeps that it was filled in the one fill the client states for both themes. embeddedHtml is where a sender's colours are still shown, that being what that surface is for. The document itself is unchanged by any of this — the colour crosses the wire exactly as before, and what it decides is a rendering question the client answers.

aiFiltersShown decides whether the client draws the standing views beneath the folder tree. With it unset or on, the tree carries a section offering three of them — the mail a significance was recorded on, the mail a commitment was, and the commitments falling due this week. Each is a shortcut to the carriesMark, markDueOnOrAfter and markDueBefore parameters above and to nothing else, so what a view puts in force stands in the list's own filter control where any other narrowing does, and can be taken off or changed there one criterion at a time. With it off the section is gone rather than empty, and nothing else changes: the criteria are still reachable from that control, and no list this deployment answers is narrowed differently.

notificationSeconds decides how long one of the client's own notifications stands, in whole seconds from 1 to 30. A notification is the one place the client offers a way back from an act, so this is also how long that offer lasts — and for a permanent delete it is how long the deployment holds the record before asking anything of the mail server, plus the grace the mutation routes describe. A value outside that range is refused naming the range rather than clamped to it: a person who asked for a minute would otherwise be handed half of one without being told, and the one screen that writes this offers nothing outside it.

A write states the whole document. It is a closed set rather than a patch: a key nothing binds is refused rather than stored, a theme this deployment does not publish is refused naming the three that are, and a preference the body omits is committed as its own default rather than left at whatever was there. The body is bounded like every other on this surface, and one past the bound is answered 413.

telemetryEnabled is the one preference whose omission is not its default. A body that leaves it out, or states it as null, says nothing about the switch, and the write keeps the answer the person stored. Both halves of the reason are about them: the default is on, so a writer with nothing to say about telemetry would otherwise opt somebody in, and a read answers the switch as it is applied rather than as it is stored — so a client that sent back what it read would state a policy's answer as the person's own, and leave them on it after the policy is gone. A client therefore states the switch in the one write the person moved it with, and the client in this repository states it in no other.

It carries no version, and the last write wins. The only writers are one person's own devices, so there is nobody whose change could be lost — and a superseded refusal here would be a conflict screen over a checkbox. That is the one way these routes differ from the record routes, which are written by an administrator too.

No route here names a user, exactly as no record route does: the preferences acted on are those of the credential that authenticated, resolved from the request rather than read out of the body or the path.

Reading is mailfathom.profile.read and writing is mailfathom.profile.write. The write is deliberately not mailfathom.mail.accounts.write, which every record write is: that grant decides what this deployment reads out of somebody's mailboxes, somebody whose mail configuration an administrator maintains in full does not hold it, and what may be said about a person must not be decided by a grant over their mail configuration. Nor is either a grant over mail, since nothing here is mail.

Nothing here reports when anything was set, or from where. This deployment keeps no record of the machines somebody signed in from, and a response saying when a switch last moved would be the beginning of one. Erasing a user erases their preferences with everything else derived from them.

A deployment that proxies no telemetry still serves these routes and stores the switch unchanged, so a person's answer survives a deployment that starts forwarding later. What such a deployment tells a client is "telemetry": "off" on the session route, and what MailFathom's own client draws for that is a sentence saying so in place of the switch — a control over a client that is already sending nothing decides nothing.

A settings policy may hold the telemetry switch

telemetryEnabled is the one preference somebody else may decide. The deployment's settings policy, or the policy of the organization a person belongs to, may force it on or off for everybody it governs. Nothing else here is ever governed: the other seven take no default, no forced value, and no editing restriction, and the switch itself takes a forced value and nothing else. ADR 0037 holds why this one, and what forcing it on takes from the person it is about.

While a policy forces the switch What these routes do
GET /api/client/preferences Answers telemetryEnabled as the forced value, whatever the person stored, and telemetryHeldBy as Deployment or Organization
POST /api/client/preferences stating the other value Answers 400 and writes nothing, in a sentence naming TelemetryEnabled, what it is forced to, and whether the deployment or the organization holds it
POST /api/client/preferences stating the forced value, or omitting the switch Commits the other seven and answers the forced value with who holds it. The person's own answer is left exactly as it was

telemetryHeldBy is null wherever the answer is the person's own, so a client reads one field to know whether the control is theirs: where it names a holder, their own answer is not what is being applied, and moving the switch would be refused. A client that moves it anyway is answered the 400 above and holds a document the deployment did not take; reading the preferences again is what gives it one the next write can state, and the client in this repository does that after every refused write.

The person's own answer is kept, and it comes back. A forced value is never written into anybody's preferences. A write that passes while the switch is held carries the stored answer forward instead of replacing it with what the body said — the write is the whole document, so storing the body's value would turn the policy's answer into the person's — and the answer they gave is the one in force again once no policy forces the switch. Nobody is left opted in, or out, by a rule that no longer exists, and that holds across the moment a force is lifted as well: a client still holding the forced value it read states nothing about the switch in its next write, so there is no body through which the policy's answer could arrive as theirs. A person who never answered stands on the unset answer, which is on. A stored row that cannot be read as a preferences document holds no answer to carry, and the write replacing it stores a refusal, which is how the telemetry routes read that row.

A write for somebody whose record this replica does not serve leaves the switch alone too. Whether a policy holds it cannot be known there, and the body may be stating a forced answer another replica read to that person's client, so the other seven are committed, the stored answer stays as it was, and the write answers what is stored.

The deployment's force wins over an organization's, as it does for every setting a policy forces: an organization holding the switch off for its members is overruled by a deployment holding it on, and telemetryHeldBy then names the deployment. A person in no organization is governed by the deployment's policy alone.

The value answered here is the value the deployment applies. The telemetry routes take or refuse a client's batches by it, so a switch that is off — the person's own or a forced one — is kept by the deployment rather than left to a client to honour. A force takes effect on a replica when that replica has adopted the policy, which is within thirty seconds of the save.

One caller is answered what they stored while something else is applied: somebody whose record the answering replica does not serve. Their batches are refused and the session route answers them off, which is what stops their client, and the read still answers their stored telemetryEnabled with telemetryHeldBy as null. That is deliberate. Nothing forced the switch and they did not refuse — the replica does not know what governs them — and a client writes back the document it read, so answering false here would arrive at a replica that does serve them as their own refusal and outlast the condition that caused it. For that caller alone a null holder does not say the control is theirs; the session answer is what says nothing is taken.

The portrait routes

These three hold the picture a person is drawn by, which the account menu and the settings screen put beside their name. It is a stored file the person's user record links to under Portrait, rather than octets inside the record: a megabyte of image is not a small closed document, and reading the record should not carry a photograph. The octets are held wherever ContentStorage:Backend places content — in the database, or in the object store mail content is written to.

Route What it does
GET /api/client/portrait Serves the signed-in person's picture under the kind it is
POST /api/client/portrait Replaces it with the octets the request body carries
DELETE /api/client/portrait Removes it, leaving everything else about the person as it was

An upload is at most 1 MB, and is a JPEG or a PNG. The bound is applied before a handler is entered, and an upload over it is answered 413 naming the megabyte. The kind is read from the signature the file opens with rather than from the Content-Type the request declared — a declared type is a string an uploader wrote, so trusting it would let anything at all be stored under an image's name and served back to a browser as one. Octets that are neither kind are answered 415 naming both. A request carrying no body at all is answered 400.

Nothing is done to the picture beyond that. It is not resized, cropped, re-encoded, or stripped of its metadata, and it is served back exactly as it was supplied — so the bound and the kind check are the whole of what stands between an upload and the store. A person keeps one picture and no history of previous ones.

A replacement writes the new file, links it, and only then removes the old one. A failure between any two of those steps leaves the previous picture in force, or at worst a file nothing links to, which a sweep removes once it is an hour old; the record never links to a file that is gone. A user record written by any other route may name only a stored file of that same user under Portrait, and a write naming anybody else's is refused.

Having no picture is answered 204, not 404. The client draws the initials it already has from the person's name, so an absent portrait is an ordinary state of the screen rather than an error on it; 404 on this surface says a route or a record is not there, which is a different thing. A person this deployment no longer holds a record for is answered 404 on the upload, and 204 on the removal like anybody else.

A portrait a policy holds is refused naming who holds it. Where the settings policy of the person's organization or of the deployment does not leave Portrait to them to change, an upload and a removal are each answered 400 with the sentence saying which of the two holds it. A policy this replica's build does not read holds the whole record, and is answered the same way with the sentence naming that policy. Nothing is stored for a refused upload, and the picture in force stays.

The served picture is named, and the client revalidates against that name. The response carries an entity tag over the octets and Cache-Control: private, no-cache, so the second screen that draws the same portrait is answered 304 rather than the picture again, while a replaced one reaches the next screen rather than the next expiry. It is deliberately not cached without revalidation: a portrait is personal data.

No route here names a user, exactly as no record route does: the picture acted on is that of the credential that authenticated, resolved from the request rather than read out of the body or the path.

Reading is mailfathom.profile.read and the two writes are mailfathom.profile.write. The writes are deliberately not mailfathom.mail.accounts.write, for the reason the preferences write is not: that grant decides what this deployment reads out of somebody's mailboxes, and what a person is drawn by must not be decided by a grant over their mail configuration.

The file hangs off the user row. Erasing a user erases their portrait with everything else derived from them, in the database and in the object store alike, and moving stored content into the object store carries it with the mail.

The drafts routes

These are what a person writes mail through, and the first thing to know about them is that a draft here is the one in the user's own drafts folder. Composing one writes a row and a stored message in this deployment and files a copy on their mail server in the same act, so there is no second kind held only here for somebody to go looking for, and no route to promote one into the other.

Route What it does
GET /api/client/drafts Lists what the signed-in user is writing, newest first, optionally narrowed to one account
POST /api/client/drafts Writes one new draft, as a message of its own or as an answer to stored mail
GET /api/client/drafts/{draftId} Opens one draft with the words its stored message carries
PUT /api/client/drafts/{draftId} Replaces one draft with what the author has written since
DELETE /api/client/drafts/{draftId} Gives one draft up, and takes its copies back out of the folder
POST /api/client/drafts/{draftId}/attachments Stages one file against a draft, the octets being the request body
DELETE /api/client/drafts/{draftId}/attachments/{attachmentId} Takes one staged file back off
POST /api/client/drafts/{draftId}/send Queues the message the draft holds, which is the one act here that reaches anybody else

Every route is scoped to the caller's own user, and a draft another user holds answers exactly as one nobody holds. A save names the account it belongs to and that name is resolved against the accounts the caller is assigned; every other act names a draft, and the identifier becomes a draft this user holds before anything acts on it. So a 404 here says nothing about whether such a draft exists somewhere in the deployment.

A draft survives a restart and is reachable from another head, because it is a row, a stored message, and a copy in the user's own drafts folder rather than anything the client holds: the desktop shell and the browser sign in to the same deployment and list the same drafts, and the user's phone shows them from their mail server.

The grants are two rather than one, because writing a draft and sending it are different powers. Writing, listing, opening, revising, giving up, and attaching are mailfathom.mail.drafts.write, whose effect reaches the user's own mailbox and nobody else's; sending is mailfathom.mail.send, which puts a message in somebody else's mailbox and is the one act here that cannot be taken back. A client granted the first alone composes freely and sends nothing. They are the same two names the drafting tools are published under, because a draft written here and a draft written by an agent are the same thing in the same folder.

Every save is an APPEND and a removal against the user's mail server, since IMAP has no command that changes a stored message. So a revision is what an author asks for rather than what a keystroke produces: the client saves when somebody says to save, and holds what they are typing until then.

An answer is written by naming what it answers rather than by quoting it. A save carries either account with subject, which is a message of its own, or answeredEmailId with answers — senderOnly, everyone, or forward — which reads the account, the subject, and the threading identifiers from the message being answered, so an edited reply stays a reply. One of that pair without the other names nothing and is refused. Answering stored mail needs mailfathom.mail.read beneath the drafting grant, because an answer is derived from the message it answers.

An upload is the request body and nothing else. There is no form to parse and no boundary to trust: the octets are the body, the file's name is the fileName query value, and what it declares itself to be is the request's own Content-Type without its parameters — a request declaring none is read as application/octet-stream rather than having its content examined. The route admits any media type, because the declared one is recorded against the file rather than checked: naming a single one would be enforced by the routing pipeline as a 415 on everything else, which is every file the author's system could name. The bound is the deployment's own configured attachment size, applied by the routing pipeline as well as by the use case, so a body past it is refused before it is buffered; how many files a draft may carry is the deployment's configured attachment count. Cancelling an upload leaves nothing behind, and a file already taken in is removed by naming it.

A refused send says which rule refused it and never what triggered it. Screening, the recipient policy, and the spending ceilings each answer with their own error code beside a sentence written for an operator to read, and the sentence carries no recipient, no subject, and no fragment of the message. 409 is a rule of this deployment about what the author already wrote, so no rewriting of the request would help; 503 is the one temporary refusal here and the only one worth retrying, and means the message was neither refused nor sent because what would have judged it could not be reached. Nothing on any of these routes reaches a log, a span attribute, or a telemetry event.

A save and a revision are screened by the same rules and answer the same way. The draft book is judged by the screening the outbox is judged by, so writing a message down can be refused for what it carries exactly as sending it can: 409 with the same error codes where a rule refused what the author wrote, and 503 where what would have judged it could not be reached. What the recipient policy and the spending ceilings refuse is the send's alone — a message merely written down goes to nobody and costs nothing. A client that reads every non-200 on those two routes as an outage tells an author their deployment did not answer when it answered precisely.

Nothing has been transmitted when a send answers. The message is queued, and the outbox routes below are where a client watches what becomes of it.

The reply drafting routes

GET /api/client/replies/drafting
{ "draftsReplies": true }
POST /api/client/replies/drafting
Content-Type: application/json

{
  "answeredEmailId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
  "selection": "Could you confirm the racking is still 4 200 net?",
  "instruction": "Confirm the price and offer Tuesday at ten."
}
{
  "drafted": true,
  "body": "Yes — 4 200 net still stands, and Tuesday at ten works for us.",
  "claims": [
    {
      "text": "The agreed price is 4 200 net.",
      "supported": true,
      "sources": [ { "kind": "email", "email": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a8f" } ]
    },
    { "text": "Tuesday at ten is free.", "supported": false, "sources": [] }
  ],
  "proposedRecipients": [
    { "address": "sales@example.test", "displayName": "Anna Kowalska" }
  ]
}

What comes back is a proposal rather than a message. Nothing on this route sends, queues, or writes to a mail server, and nothing is stored: the reply arrives as text in the composer or in the card under a correspondence, which its author edits, discards, or saves through the drafts routes above. Every irreversible act stays behind a person confirming it.

The read says whether this deployment drafts at all, which is what decides whether a composer may offer the affordance before anybody presses it. It resolves a registration and calls no provider, so a client asks it once and holds the answer. false is what a deployment with no chat section answers and what one whose operator wrote Chat:ReplyDrafting:Enabled off answers; the two are deliberately one answer, because what a client does about either is identical and naming which would publish a deployment's configuration to every signed-in browser.

The request names one message and states nothing else about it. The conversation the draft is grounded in, the account whose manner it is written in, the subject, and the people it may propose are all read out of the stored copy that identifier resolves to, so a client can state none of them and can state none of them wrongly. selection is the part of the correspondence being answered and instruction is what the reply should say; both are optional beside a message, and a request carrying neither is the ordinary one.

answeredEmailId is null for a message that answers nothing, which is the composer somebody opened with nothing in front of it. There is then no conversation to read, so instruction is what the message is written from and is required there — a request naming neither is refused with 400, because it would be a provider call made to invent a message out of nothing at all. The language follows the same split: a reply is written in the language the conversation it answers is written in, and a message answering none is written in the language this deployment recorded for that user, which the user record holds. An instruction asking for a particular language outranks both, being the one thing the person said about the message themselves.

The client asks for a draft in two places, and neither reaches another screen. The block the design draws over the composer's body is one — the field says what the message should be about, the act beside it says what shape it should take, and the two travel as one instruction. What comes back replaces the words in the composer with the way back beside them, and a draft nobody has accepted is named in the send confirmation before the message goes out. The field under a correspondence is the other: Draft a reply asks for a reply to the message being read, with the fixed sentence Write a reply to this message. and whatever was typed there joined as one instruction, and the passage selected in the message as the selection, and draws the answer as a card under that message, even with the rest of the correspondence shown, that says nothing has been sent. The card is held in memory and nowhere else; Open in composer carries its words into the composer on that message without asking the deployment again, over whatever that tab was already writing for the same answer, which stays the way back — and Discard draft lets it go.

supported is published beside the sources rather than left to a client to derive. A claim carrying none is one the correspondence does not back, and it is kept and marked rather than dropped, because the sentence is already in the body somebody is about to send. Each source is spelled as the citation route spells a target, so following one is the same POST /api/client/citations/resolution a Discover answer's sources are followed through.

proposedRecipients are shown and never applied. Every one of them is a person the conversation itself names, resolved inside the deployment, and the account's own sending address is never among them. A composer draws each as a proposal to accept, change, or remove.

drafted: false is the composer as it was rather than a failure. It is what a deployment drafting no reply answers, and what this one answers while its provider is unreachable or wrote something unreadable; a client leaves the field empty and reports nothing. A message this user does not hold is 404. The one exception is a spend ceiling: a deployment that has spent what its operator allows a provider answers 429, because falling back there would leave somebody pressing a button the allowance has already been spent on.

Everything travels in a body, which is why drafting is a POST for an operation that stores nothing: what somebody is asking a reply to say is as revealing as the correspondence it answers, and a query string is the part of a request that reaches an access log by default, here and on every proxy in front of this deployment. A body over 16 KiB is refused before it is read, a request naming no message and an over-long selection or instruction are refused with 400, and a refusal never echoes what was sent.

Both routes are published under mailfathom.assistant.use rather than under the reading grant, because that is what drafting does: the conversation and a sample of the account's own sent mail leave this deployment for a chat provider, and the call is charged to the same allowance a question is. A credential holding only mailfathom.mail.read is answered 403, and so is one holding only the asking grant on POST: a draft is written from the conversation it answers, which is mail, so drafting asks for mailfathom.mail.read beneath the grant the route is published under. GET reads no mail and answers on the asking grant alone. Nothing about a draft reaches a log or telemetry on either route. Drafting a reply holds what a draft is written from and what never leaves.

The calendar event drafting routes

GET /api/client/calendar/drafts
{ "readsDescriptions": true }
POST /api/client/calendar/drafts
Content-Type: application/json

{ "description": "racking survey on Thursday at half past ten, an hour" }
{
  "drafted": true,
  "title": "Racking survey",
  "start": "2026-09-24T10:30:00+02:00",
  "end": "2026-09-24T11:30:00+02:00"
}

What comes back is fields rather than a calendar entry. Nothing on this route writes an event, and nothing is stored: the answer is a reading of the sentence, which a caller presents for whoever typed it to correct and submit through POST /api/client/calendar, the route that writes one. The client's Calendar screen is the caller: what it reads out of a sentence goes into the fields of the dialog that writes the event, and nothing is written until somebody saves it there.

The read says whether this deployment reads a description at all, so a caller can ask once and leave the field out where nothing would answer it. It resolves a registration and calls no provider, so the answer is cheap and stable enough to hold. false is what a deployment with no chat section answers and what one whose operator left Chat:CalendarEventExtraction:Enabled off answers; the two are one answer for the reason the drafting read above gives.

The instant the sentence is resolved against is the caller's own, and this deployment reads it rather than being told. Every relative day and hour in the sentence — tomorrow, Thursday, the week after next — is resolved against the moment the person asking is standing on, which is this process's clock read in the time zone their user record states; that zone is what makes half past ten their half past ten rather than the deployment's. The zone routes are where it is read and corrected, and a record stating none is read in UTC.

drafted: false is an ordinary answer rather than a failure. A sentence naming no occasion, a deployment reading none, and a provider that could not be reached are one answer, because there is nothing a caller could usefully do differently about each: it has no fields to fill and nothing to report. The exception is the same one the drafting route makes — a deployment that has spent what its operator allows a provider answers 429, because nothing sent for the rest of the period will be read, and that is a condition a caller has to act on.

Everything travels in a body, for the reason drafting does: what somebody is arranging is the most revealing value this route carries, and a query string is the part of a request that reaches an access log by default. A body over 4 KiB is refused before it is read, a missing or over-long description is refused with 400, and a refusal never echoes what was typed. The body is strict — a key nothing binds is refused with 400 — so a client still sending the instant it wrote at is told, rather than having the field dropped and the description read against this deployment's own clock.

Both routes are published under mailfathom.assistant.use, because the sentence leaves this deployment for a chat provider and the call is charged to the same allowance a question is. Nothing about a description or a drafted event reaches a log or telemetry on either route. Reading a calendar event out of text holds what counts as an event, why a deadline is not one, and what reaches the provider.

The outbox routes

These are what a client draws after a message has been sent: the send the user just asked for has not left yet, and this is where the screen watches it go, takes one back while it is still queued, or offers a failed one another chance.

Route What it does
GET /api/client/outbox Reads one page of the named account's outbox, optionally narrowed to one stage
GET /api/client/outbox/{outgoingEmailId} Reads one send, with what the server told this deployment about each recipient
POST /api/client/outbox/cancellation Withdraws one send that has not begun transmitting
POST /api/client/outbox/requeue Offers one send again

A listing names an account and never the deployment. The narrowing is required rather than optional, so there is no unnarrowed reading here at all: one that fell back to every account would page through every user's outgoing mail, which is the deployment-wide catalog a user-facing surface must never compose. An account another user owns is refused exactly as one nobody configured, and a send another user made answers exactly as one nobody made.

What the answers carry is what the administrative outbox already settled. A page names no recipient and no subject, because a page of an outbox would otherwise be an export of who this user writes to, a page at a time; one send read by identity names its recipients and what the server said about each, because that is the question it was asked. Neither reads the message, at any size.

A decision reports what became of the send it named rather than refusing. A send that has gone past the point of recall, and one this user does not hold, are outcomes in the answer — which is exactly what somebody acting on a screen a moment old needs. Only a request naming no send at all is refused. Each decision names one send and never a set, because a message whose outcome nobody knows may already be in somebody's mailbox, so a filtered re-queue would be an unknown number of duplicates asked for in one request.

Every route here is mailfathom.mail.send, the two readings included. What an outbox says is what this user is sending, so a credential granted to read a mailbox learns nothing here, and withdrawing a send is part of sending rather than a power beside it.

The contact routes

These are the signed-in person's own address book: the people they wrote down, the people their own mailboxes picked up from mail that arrived, and the four things they do about either.

Route What it does
GET /api/client/contacts Reads one page of the people this user wrote down
GET /api/client/contacts/collected Reads one page of the people this user's own mailboxes picked up
GET /api/client/contacts/{contactId} Reads one of them
POST /api/client/contacts Records somebody this user's own book does not yet hold
PUT /api/client/contacts/{contactId} Amends one to the record the request states
POST /api/client/contacts/{contactId}/promotion Takes on a collected record, so it becomes one this user asserted
DELETE /api/client/contacts/{contactId} Erases one person and everything the book derived from them

The book is read as two, because it is two. What somebody wrote down and what their mailboxes picked up are different things to a person looking at a screen — one is an address book, the other is everybody they have ever been written to by — so each is its own paginated route rather than one listing with a filter a client has to know to send. Both walk the same order, so a cursor either returns continues in the other. Neither is unbounded: a request naming no page size is served fifty and one asking for more than two hundred is refused rather than quietly served two hundred, which is what stops a request deciding how much of a person's correspondents leaves the database at once.

Either listing takes a search, which is how the composer offers recipients as somebody types: text a contact has to carry in its name or in one of its addresses, matched the way Contacts § Reading the book states, over the page size the request names. A blank search narrows nothing. One longer than 320 characters — the longest address the book can hold, so text past it can match nobody — is refused with a 400 before anything is read, and the refusal names the rule rather than the text, which is somebody's name or address being looked up.

No request names a user. The books reached are this user's own and the collected book of each mail account they are assigned, resolved from the session rather than from the request, so a contact somebody else holds answers exactly as one nobody holds. That is the whole difference from the administrative contact routes, which name the user they act for and are read under the administrative grants.

Every write records somebody the user wrote down. What a person types into their own client is a person they wrote down, so a write here is asserted rather than collected — which is why amending a record one of their mailboxes collected is answered OriginRefusesWriter rather than performed. Promotion is the act that resolves it: it writes this user's own copy of the collected record, which they then amend like any other. Erasing is not gated that way, because somebody asking to be taken out of a contact book is not answered with which book they happen to be in — so an erasure reaches a collected record too, and takes it out of that mailbox's book for every user assigned the mailbox.

A write reports an outcome rather than refusing. A person the books do not hold, an address another contact already holds, a record whose origin refuses the writer, and a promotion of somebody already asserted are all named in the answer, because each is something a screen reports and continues from. Only a request that is not a request — no body, or the all-zero identifier no contact carries — is refused, and a refusal names the rule rather than the value: a malformed address is reported as an address that is not usable and never echoed, because a problem document is the one part of an answer a proxy log keeps.

Two of the administrative routes are deliberately absent. There is no export, because that is what a data-subject request is answered from and it belongs on the surface an operator answers one from; and there is no bulk erase of a whole collected book, because emptying what one mailbox picked up is an act about the mailbox rather than about whoever reads it.

Reading is mailfathom.contacts.read and every write is mailfathom.contacts.write, the same split the tools over this book publish. The erasure is behind the writing grant rather than a narrower one: a grant that may edit the book may take somebody out of it, and no smaller grant reaches an act that cannot be undone.

The contact correlation route

GET /api/client/contacts/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90/correspondence

It answers with what the mail this caller may read already holds about one contact — the conversations their addresses appear in, and the documents they sent:

{
  "contactId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
  "threads": [
    {
      "threadId": "0198f4c2-7d8e-7b2f-a041-52c637d8e9fa",
      "latestMessageId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
      "subject": "Renewal terms",
      "lastCorrespondedAt": "2026-03-04T09:01:12+00:00"
    }
  ],
  "documents": [
    {
      "messageId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91",
      "position": 1,
      "fileName": "renewal.pdf",
      "mediaType": "application/pdf",
      "receivedAt": "2026-03-04T09:01:12+00:00"
    }
  ]
}

Nothing here is stored. Both lists are computed from the mail index on the read, so a contact record never carries a copy of a correspondence that could fall behind the mailbox. Reading a contact costs the record; reading this costs the correlation, which is why it is a route of its own rather than a member of what the contact routes above answer with.

threadId is what the conversation route is asked with, latestMessageId what the message route is asked with, and messageId with position what the attachment route is asked with. Nothing in either list has to be resolved to be opened.

A conversation's entry is read off the most recent message in it naming this person, which is what subject and lastCorrespondedAt describe. An exchange that has run on without them is reported at the point they last took part in it rather than at its own latest message, because what an opened contact answers is when this exchange last involved them.

A document is one the contact sent: the message it arrived on was written from one of their own addresses. A file somebody else attached to a conversation this person was copied on is that person's document rather than this one's. The list is read from the attachment index, so a file no derivation has reached yet is absent and appears as the derivation catches up — and a deployment that never switched attachment reading on (Embeddings:AttachmentText:Enabled, which attachment text extraction describes) wrote no such index and answers with no documents at all.

Both lists are bounded and neither is paged: at most ten conversations and ten documents, out of the messages received in the last year. Below that the two are cut differently. The conversations are the distinct ones among the most recent two hundred messages naming this person, so an exchange they wrote more than that many messages in is what the list reports. The documents carry no scan bound of their own — they are the ten most recent files on mail this person sent inside the window, so one they sent stays reachable however many later messages have merely named them. A reader who wants the rest of an exchange opens the conversation, and one who wants everything a person ever sent searches for their address.

Only mail this caller may already read takes part. The correlation runs over the accounts the signed-in user is assigned and the folders a mapping admits, with the junk folder left out, so a message withheld from this caller is outside the query rather than filtered out of its answer — neither list ever carries an entry marked withheld.

A contact no book in this caller's scope holds is answered 404, which is also the answer for a contact nobody ever held: neither discloses the other. A contact the window holds no mail of is answered 200 with two empty lists, which is the accurate answer rather than a missing one. A credential whose grant does not carry mailfathom.mail.read is answered 403, and so is one missing mailfathom.contacts.read — the refusal names which. It is served from the local copy, so it contacts no mail server and cannot set the remote \Seen flag.

The contact relationship route

GET /api/client/contacts/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90/relationship

It answers with the note an opened contact is headed by: the correlation above read into a few sentences, one suggested next action, and a handful of observations, each citing what it rests on.

{
  "contactId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
  "derived": true,
  "note": {
    "text": "They lead the renewal on the supplier's side and have been writing weekly since March. The last exchange left the indexation cap open.",
    "sources": [{ "kind": "email", "email": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91" }]
  },
  "nextAction": {
    "text": "Answer the indexation cap so the renewal can be signed.",
    "sources": [{ "kind": "email", "email": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91" }]
  },
  "observations": [
    {
      "aspect": "ActivePeriod",
      "statement": {
        "text": "mornings, early in the week",
        "sources": [{ "kind": "email", "email": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91" }]
      }
    },
    {
      "aspect": "OpenItem",
      "statement": {
        "text": "the indexation cap",
        "sources": [{ "kind": "attachment", "email": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a91", "attachmentPosition": 1 }]
      }
    }
  ]
}

One opened contact is one bounded AI run, and nothing else ever starts one. There is no sweep over the address book, no schedule, and no background pass: a contact nobody opened costs nothing. Where a correspondence with one person stands is what the run reads, what it may say, and what it may not.

derived is the whole of what a client branches on. It is false where this deployment derives no card at all — no chat endpoint, or the operator turned it off — and equally where the allowance was spent, the provider could not be reached, the answer was unreadable, or this person's mail carries nothing to rest on. All of those leave the contact page exactly as it was drawn before this route existed, so a client draws no card and reports no failure. The absent case is answered without the book or the mail being read at all, which is what makes asking it cheap on a deployment that derives nothing.

Every statement carries at least one source, and one that carried none was dropped before the answer was composed. A card is read instead of the correspondence it came from, so a sentence nothing backs would sit beside the sourced ones looking identical. sources is spelled the way the citation route is asked: a conversation as the message it was last carried by, a document as that message's own attachment.

aspect is one of ActivePeriod, OpenItem, or Case, and the set is this deployment's rather than a producer's — an aspect the run said nothing about is absent rather than present and empty, and no other value is ever published. A card carries at most one observation per aspect.

A contact no book in this caller's scope holds is answered 404, the same answer a contact nobody ever held gets. A credential whose grant does not carry mailfathom.assistant.use is answered 403, and so is one missing mailfathom.mail.read or mailfathom.contacts.read, which the correlation and the book ask for themselves — the refusal names which. It reaches no mail server and cannot set the remote \Seen flag.

The notification routes

These are the notification centre: what happened to a person while nobody was looking at their screen, how much of it they have not read, both ways of marking it read, and taking rows out of it for good. What they serve is a record this deployment produced — an IMAP synchronization run writing down that mail arrived or that a credential was refused, a reminder coming due — rather than a second reading of the mailbox.

Route What it does
GET /api/client/notifications Reads one page of the signed-in person's notifications, newest first
GET /api/client/notifications/unread-count Reports how many of them stand unread, without reading a page
POST /api/client/notifications/{notificationId}/read-state Puts one notification into the read state the body states
POST /api/client/notifications/read Marks every one of the person's unread notifications read
POST /api/client/notifications/deletions Erases the notifications the body names, one or several at a time

A raised notification reaches an open client at once, and the routes above are still what it reads. The signal channel says that a row was written and how many now stand unread; the panel then re-reads a page over these routes, so nothing about the record travels twice and a client with no channel behaves exactly as one that never had it — it asks on an interval and when it comes back to the foreground. The count is the answer it asks for most, which is why it stands on a route of its own: a badge derived from a page would cost a screen's worth of rows to draw one number, and it is answered from the same index the deduplication rule already declares.

A page is clamped rather than refused. A request naming no pageSize is served 30, one naming more than 100 is served 100, and one naming zero or a negative number is served the default. That is the one place this reading differs from the mail list and the outbox, which refuse a page size out of range: those serve an operator or a query composed by hand, and this serves a panel asking for as much as it can draw, where a refusal is an error a screen has to render instead of a list. The cursor is the one thing here that is refused, because a boundary this deployment never issued names no page and answering it with the newest one would be a panel silently jumping back to the top. Paging is keyset rather than offset, so a notification raised while somebody is reading neither shifts the window nor repeats a row; the walk ends when nextCursor is absent rather than when a page comes back short.

No route names a user. The person is the one the credential authenticated, exactly as on the record routes, so a reading of somebody else's centre cannot be composed. The one route that names a record names it by identifier, and a notification another person holds answers 404 exactly as one nobody holds — so nothing here reports whether such a notification exists.

A row carries what a list draws and stops there: the kind, what the notification says, a headline, a second line, what the source line names beyond the kind, where opening it leads, when the thing it describes happened, and whether it has been read. Everything a row draws was derived when the notification was produced, so drawing the centre re-reads no mail — and no mail body, no address, and no attachment reaches these answers at any size. The deduplication key is absent: it is the rule's own name for a condition rather than anything a screen renders.

What a notification says is a condition and its numbers, and the sentence is the client's. statement carries a cause — MailArrived, SynchronizationIncomplete, CredentialRefused, CalendarReminderDue, or TaskReminderDue — beside counted and outOf, whose meaning is the cause's to give: mail counts the messages that arrived, an unfinished run counts the folders that did not finish out of the folders it scheduled, a due reminder counts the minutes between now and the event, and a refused credential counts nothing. A client turns that into a sentence in whatever language its reader has, which is why the service sends no sentence of its own for it to translate. title and body beside it are that same statement written out in English, for a reader with no client to say it in their own; a client that recognizes the cause draws the statement and ignores them. statement is null on a row a deployment wrote before it kept conditions, which is what an upgrade over existing data leaves until retention has taken those rows, and a cause a client does not recognize is read the same way — the English is what both of them draw.

Erasing is one route rather than a path per notification, and it names what goes. The body is {"notificationIds": [...]}, because a person clearing one row and a person clearing the eleven they ticked are the same act with a different count. A request naming more than 100 is refused with 400 rather than served in part, which is the opposite of what the page size above does and deliberately so: erasing the first hundred of a longer list and answering 200 would report an act nobody asked for, on rows nobody saw, and this is the one act here that cannot be taken back. An identifier that names nothing is not an error — a notification another person holds and one already erased are the same answer, neither is counted and neither is reported — so deleted is what happened rather than what was asked for, and nothing here says whether a notification the caller does not hold exists. The answer carries unreadCount beside it, so removing an unread row redraws the bell from what the deployment holds rather than from a subtraction on the screen. Nothing about the mail a notification described changes: the record is what this deployment derived, and the message it points at stays exactly where it is.

Marking one unread can be refused, and only in that direction. One unread notification stands per condition, so a condition said again after this one was read already stands unread in its place; asking for the older one back is answered 409 and the row stays read. Marking read is never refused, and asking for the state a notification already stands in is answered as done rather than as an error.

Every write answers with what a client redraws from. The read-state route reports the notification, its new state, and how many remain unread; the mark-all route reports how many it moved and that none remain; the erasure reports how many went and what stands unread after them. None of them needs the page to be fetched again to find out what the request produced.

The two reads are mailfathom.notifications.read and the three writes are mailfathom.notifications.write. Neither is a grant over mail: a notification is what this deployment drew for one person, so marking one read and taking one out of the centre reach no mail server and move nothing in a mailbox, and a person whose mail accounts an administrator maintains clears their own bell under a grant that says nothing about those accounts. mailfathom.mail.delete is the power to remove somebody's mail and is not what the erasure asks for: what leaves is a record about a message that stays. Opening the message a notification points at is mailfathom.mail.read, as it is from anywhere else.

Where opening one leads is one of five shapes, and target carries the one the producer chose: Nothing, Message with a messageId, Screen with a screen, CalendarEvent with a calendarEventId, and PersonalTask with a taskId — the last two being what a due reminder names, and how a client reaches the record it is about. A row carrying a shape a client does not recognize leads nowhere rather than being drawn as an error.

A reminder is the one row whose headline names a record. title is what the person called their own event or their own task, because there is nothing else a reminder is about and no catalogue could hold it, so a client fills it into its own sentence rather than replacing it. Everything else about the record stays on the record.

A notification is kept for thirty days and no longer, and one pointing at a message is erased with that message. Both are the record's own bounds rather than these routes', so a centre that reaches back no further has aged out rather than lost anything.

The task routes

These are the signed-in person's own list of what they owe: what they have committed to, what mail proposed and nobody has agreed to yet, and the six acts they perform on one task. What they serve is a list native to this deployment — no external task-management protocol is spoken here, and a task is a row in the same database as everything else.

Route What it does
GET /api/client/tasks Reads one page of what this person has committed to, soonest due first
GET /api/client/tasks/proposed Reads one page of what mail proposed and nobody has accepted
GET /api/client/tasks/{taskId} Reads one of them
POST /api/client/tasks Records a task this person has just committed to
PUT /api/client/tasks/{taskId} Writes the line and the day they edited
POST /api/client/tasks/{taskId}/completion Puts one task into the completion state the body states
POST /api/client/tasks/{taskId}/acceptance Takes on a proposed task, so it becomes one this person owes
DELETE /api/client/tasks/{taskId} Erases one task, which is also how a proposal is dismissed

The list is read as two, because it is two. What somebody has committed to and what mail suggested are different things on a screen — one is a list of what is owed, the other an offer — so each is its own paginated route rather than one listing with a filter a client has to know to send. Both walk the same order, and a cursor is refused in the half it was not issued for, which is what stops a walk of the proposals continuing into the commitments halfway down a screen. The order is the day ascending with the undated tasks last and the identifier breaking a tie, which is also the order a list is drawn in; grouping those days into today, this week, and the rest is the screen's own work.

A page is clamped rather than refused. A request naming no pageSize is served 50, one naming more than 200 is served 200, and one naming zero or a negative number is served the default — the notification routes' answer rather than the mail list's, because this serves a panel asking for as much as it can draw. The cursor is the one thing here that is refused, because a boundary this deployment never issued names no page. Paging is keyset rather than offset, so a task dated, completed, or accepted while somebody is reading neither shifts the window nor repeats a row; the walk ends when nextCursor is absent rather than when a page comes back short.

Completed tasks are served with the outstanding ones, carrying completed, because whether a list shows what is done is the screen's decision: a route that hid them would leave a person no way to see what they did today, and one that filtered them would need a second route to get them back.

No route names a user. The person is the one the credential authenticated, exactly as on the record routes, so a reading of somebody else's list cannot be composed. A task another person holds answers 404 exactly as one nobody holds — so nothing here reports whether such a task exists.

A row carries what a list draws and stops there: the identifier, the line, the day, the leads it is announced at, the instants those leads fall at, where the task came from, whether it is done, and the message it cites. No subject, no body, no address, and no attachment reaches these answers at any size. The citation is an identity rather than a reading of the message, so a client that draws the link follows it over the message route under the grant that publishes reading mail — and a task whose message has since been erased finds nothing there, because what a person owes does not stop being owed when the mail naming it goes.

A write states the line, the day, and what announces it, and nothing else. {"title": "...", "dueOn": "2026-09-21", "reminders": [0, 1440], "dueDayOffsetMinutes": 120} is the whole of what a creation and a revision carry, beside the optional sourceMessageId a creation may cite; a day is written yyyy-mm-dd and absent where nobody has said when. A key nothing here binds fails the bind rather than being ignored, so a client that tried to state an origin or a completion is told rather than having its request read as a rename that dropped the rest.

A task is announced from nine in the morning on the day it is due, which is the reminders page's rule rather than these routes'. reminders states the leads in whole minutes before that hour, and dueDayOffsetMinutes states the whole-minute UTC offset that day runs in — a client sends it rather than the zone itself, because the offset a zone runs at depends on the day and a due day three weeks out may fall on the other side of a daylight-saving change. Which zone the client resolves it in is the reader's own record, and the machine's own where that record states none. The answer carries reminders longest lead first and remindsAt beside it, the instants each one falls at, so the hour is derived in one place rather than in every client. The offset itself is not answered with: a client states its own on every write and never reads one back.

A request naming no lead announces nothing, whatever offset it states. Turning the last reminder off is a revision stating a task with no leads, which is what makes reminders part of the record an edit states rather than a field it may leave out. Where a task came from and whether it is done each move through the act that owns them, which is what stops a rename turning a proposal into a commitment. A creation is always asserted: what a person types into their own client is something they owe, and a proposal arrives through the extraction that read the mail.

Refusals name the rule rather than the value. A missing or blank title, a title past 200 characters, a day that is not yyyy-mm-dd, and a set of leads no task may carry — more than sixteen, one stated twice, one outside nought to four weeks, one against a task nobody has dated, or one with no usable dueDayOffsetMinutes — are each answered 400 naming the bound, and none of them echoes what was sent — a task's title is a line a person wrote about their own correspondence, and a problem document is the part of an answer a proxy log keeps.

Dismissing a proposal is the erasure rather than a route of its own. Declining what mail suggested and deleting something a person owes leave the same list behind, so a second path would be two names for one act told apart only by the word a screen puts on the button. The erasure answers 200 with erased either way: a task already gone and one another person holds are the same answer, and neither is an error.

Accepting twice, and completing something already completed, are answered as done. A state a task already stands in is the state the caller asked for, so a repeated press is a no-op rather than an error — and accepting moves the row that already exists, so a commitment keeps the identity it was proposed under and whatever already points at it still points at it.

The three reads are mailfathom.tasks.read and the five writes are mailfathom.tasks.write. A task is this deployment's own record of what one person owes: nothing here reaches a mail server, nothing moves in a mailbox, and the message a task cites is a value it carries rather than mail these routes read — so neither is a grant over mail, and a person whose mail accounts an administrator maintains keeps their own list under a grant that says nothing about those accounts. mailfathom.mail.delete is the power to remove somebody's mail and is not what the erasure asks for: what leaves is a commitment about a message that stays.

The day-layout routes

These are the two routes behind Lay out today: one says whether this deployment arranges a day at all, and the other arranges one. Nothing here writes: an arrangement is drawn beside the list the person already holds and comes to nothing unless they act on it, through the routes above that own each of those acts.

Route What it does
GET /api/client/tasks/today/layout Says whether this deployment arranges a day
POST /api/client/tasks/today/layout Suggests an arrangement of one day, and changes nothing

Which hours are somebody's day is their client's to state. The body carries from and until as ISO 8601 instants, exactly as the calendar window does and for the same reason: nothing here reads the reader's recorded zone to decide which hours a day covers, so the offsets their own client drew are what say which day is meant. A window that closes before it opens, or runs longer than 48 hours, is answered 400 naming the rule; a body stating neither instant is answered the same way.

What is arranged is what they owe by that day. The committed half of the list is read — a proposal nobody accepted is not work they owe — narrowed to the tasks due on or before that day and not yet done, soonest due first and at most 20 of them. An undated task is not part of any particular day and stays where it is. What the day is already spoken for is read through the calendar route's own reading, narrowed to the events on the calendar rather than the dates mail proposed.

The answer names tasks and never repeats them. placements carries taskId, startAt, and minutes for each task the arrangement placed, earliest first; notToday carries the identifiers of the ones that do not realistically fit. A client draws each row from the task it already holds, so no line of anybody's list travels back over this route. A placement falls inside the window that was asked about and runs between 5 and 480 minutes, and a task appears in at most one of the two lists.

A deployment that arranges no day answers 200 saying so, with arranged false and both lists empty, and so does a provider that did not answer. The two are one answer on purpose — what a client does about either is identical, and naming which would publish a deployment's configuration to every signed-in browser. GET is what a screen asks before it offers the control, so a deployment that composes nothing is not offering a button that fails. A spent allowance is the one refusal that travels, as 429, because falling back to "nothing arranged" would leave somebody pressing a control the last of the allowance has already been paid for, told nothing.

Both routes are mailfathom.assistant.use rather than the read grant the rest of the list is served under, for the reason reply drafting carries that grant: arranging a day is a provider call charged to the same allowance a question is. It is what the call costs that decides the grant here, rather than which of this deployment's own records were read to compose it. POST asks for mailfathom.tasks.read and mailfathom.calendar.read beneath it as well, for the reason the contact card asks for the grants its correlation needs: the tasks and the calendar it reads to compose the turn are those grants' own records, so a caller holding the asking grant alone is refused naming the one they are missing. GET reads neither and answers on the asking grant alone.

The calendar routes

These are the signed-in person's own days: the events they put on their calendar, the dates their mail proposed to them, and the five things they do about either. Nothing here reaches a mail server or a calendar server — a MailFathom event is native to this deployment, and calendar events holds what one is.

Route What it does
GET /api/client/calendar Reads one window of the calendar, earliest first
GET /api/client/calendar/{eventId} Reads one event
POST /api/client/calendar Puts an event this person states on their calendar
PUT /api/client/calendar/{eventId} Amends one to the record the request states
POST /api/client/calendar/{eventId}/acceptance Takes a date their mail proposed onto the calendar
DELETE /api/client/calendar/{eventId} Removes an event, which is also how a proposal is dismissed

Every read is a window, because every view over a calendar is one. A month, a week, a day, and an agenda are four spans rather than four questions, so one route answers them all and the client states the span it drew:

GET /api/client/calendar?from=2026-09-21T00:00:00Z&until=2026-09-28T00:00:00Z&origin=Asserted&count=200
{
  "events": [
    {
      "id": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90",
      "title": "Kick-off",
      "start": "2026-09-21T09:00:00+00:00",
      "end": "2026-09-21T10:00:00+00:00",
      "isAllDay": false,
      "reminders": [1440, 15],
      "remindsAt": ["2026-09-20T09:00:00+00:00", "2026-09-21T08:45:00+00:00"],
      "origin": "Asserted",
      "sourceMessage": "0198f2c3-4d5e-7f80-9a1b-2c3d4e5f6071",
      "recordedAt": "2026-09-18T11:04:19.512+00:00",
      "amendedAt": "2026-09-18T11:04:19.512+00:00"
    }
  ]
}

from and until are both required, and the window is half-open: an event beginning exactly as it closes, or ending exactly as it opens, is outside it, which is what lets two consecutive days, weeks, or months answer for every event exactly once between them. An event is in the window when any part of it falls inside, so a meeting that began before the window opened is still what the day it runs into shows.

What bounds a read is how many events it may answer with rather than how long the span may be. A year of an agenda is an ordinary request; the number of rows is what decides the cost of answering. count defaults to 200 and may name anything up to 1000, and a window outside that — or one that closes before it opens — is refused with 400 rather than narrowed to what this deployment would serve: a screen that asked for a year and was served a month would be missing eleven of them while believing it drew the year. A window that came back with as many events as it asked for is a window whose span is too wide to draw at once, and the client asks about a shorter one.

origin names which half of the record to read, as Asserted or Proposed, and naming neither reads both. The two are drawn in different places — the calendar itself, and the dates mail named that nobody has agreed to — which is why a caller asks for one rather than sorting the answer out afterwards. Only those two spellings are admitted: the number behind an enum member is not part of this contract, and origin=1 is refused.

No request names a person. The calendar reached is the one the credential authenticated, so a reading of somebody else's days cannot be composed, and an event another person holds answers 404 exactly as one nobody holds. The all-zero identifier no event carries answers 404 too.

A write states the whole record rather than the difference from the one held. Creating an event names its title, its start, an optional end, whether it is stated as a day, what is to announce it, and optionally the message it was created from; amending one names the title, the start, the end, the day statement, and the reminders it is to stand with, and changes neither the identity, the origin, nor the message it cites. What a person types into their own client is on the calendar rather than offered to it, so a created event is always Asserted — nothing here produces a proposal.

Accepting a proposal is a route and dismissing one is not. Acceptance changes what the record claims and keeps the identity, the message, and everything derived from it pointing at the event the person now holds; it answers 409 where the event is already on the calendar, because a second acceptance is a caller acting on a proposal somebody already took and answering it as done would move the record of when the event actually reached the calendar. A dismissal removes the row, which is the same act as deleting an event somebody typed — a date nobody wanted is not a fact worth keeping — so DELETE serves both and answers 204, or 404 where the calendar holds no such event.

reminders is the leads the event is announced at, in whole minutes before it, and omitting it or sending [] is an event that announces nothing — which is a statement rather than an omission, so turning the last reminder off is an amendment carrying an empty list rather than one leaving the field out. At most 16 leads, each between 0 and 40320 minutes and each stated once; a set breaking any of those is refused with 400 naming the rule. The answer reads them back longest first, with remindsAt giving the instant each one currently falls at in the same order — a client draws those rather than deriving them, because what an isAllDay event's reminders are measured from is this deployment's rule. isAllDay says the event names a day rather than a clock time: its start is still the instant the day opens at, and its reminders are measured back from nine in the morning on it. Calendar events holds why, and reminders what raises one.

A refusal names the rule rather than the value. A title that is blank, longer than 200 characters, or carrying a character that renders as nothing is refused with 400 stating that rule, and the title itself is never echoed: a problem document is the one part of an answer a proxy log, a trace, and a client's captured error all keep, and a title says who somebody is meeting. An end that is not after its start is refused the same way, when the event is created and again whenever it is amended.

The two reads are mailfathom.calendar.read and the four writes are mailfathom.calendar.write, on the reading the task routes above are split by. An event is this deployment's own record of when one person is committed: nothing here reaches a mail server, nothing moves in a mailbox, and the message an event cites is a value it carries rather than mail these routes read. mailfathom.mail.delete is the power to remove somebody's mail and is not what the deletion asks for — what leaves is a date about a message that stays.

What these routes do not serve. There is no recurrence and no external calendar synchronization; calendar events states which of those are refused as ideas and which are simply not part of the record today. A file somebody hands over is a different thing and has two routes of its own below. A reminder that has come due is not read here either: it arrives as a notification on the notification routes, which is how a client learns about one whether or not it was open when the reminder fell.

The calendar import routes

A conference programme, a schedule exported from another calendar, a single invitation saved to disk — each arrives as an .ics file, and these are the two routes it reaches a calendar over. Reading one is not synchronization: nothing is subscribed to, nothing is polled, nothing is written back, and nothing the file names causes an outbound request of any kind.

Route What it does
POST /api/client/calendar/import/summary Reports what the file would create and skip, writing nothing
POST /api/client/calendar/import Puts the events the file names on the calendar

The summary is the acceptance rather than a courtesy. Nothing creates a calendared event without somebody typing or accepting it, and a file prepared by somebody else is exactly the case where having chosen it says little about what it holds. So a client shows what the first route reports and calls the second only once the person has confirmed it. The two read the same file the same way and answer with the same shape:

POST /api/client/calendar/import/summary
Content-Type: text/calendar

BEGIN:VCALENDAR
...
END:VCALENDAR
{
  "events": 68,
  "earliest": "2026-10-05T07:00:00+00:00",
  "latest": "2026-10-09T15:30:00+00:00",
  "skipped": [
    { "reason": "Recurring", "count": 8 },
    { "reason": "AlreadyOnTheCalendar", "count": 4 }
  ]
}

The confirmation carries the file again rather than a token. Nothing is staged between the two calls, so there is no half-import to expire, to clean up, or to leave an entry of somebody's day sitting in this deployment while they decide. The body is the file itself, sent as text/calendar or as application/octet-stream for a browser that reported no type at all; neither is trusted, and what the octets are is decided by parsing them.

What the file left undecided is read in the person's own zone. An entry stating a UTC instant or naming its own TZID resolves to the instant the file names. Two shapes name no zone — a floating time, which RFC 5545 defines as the local time of whoever reads it, and an all-day entry, whose day opens at a different instant in every zone — and both are read in the zone that person's record states, which is the coordinated zone where it states none. Neither route takes a zone of its own: one the request carried could name a zone nobody chose, and the same file opened on a second machine would then land on a different day than it did on the first.

An entry this deployment has no event for is skipped and counted rather than failing the file. There are nine reasons, and each says one thing about the entry:

  • Recurring — it carries RRULE, RDATE, or RECURRENCE-ID. A MailFathom event is a single occasion and nothing here expands a series into one.
  • NoStart — it names no start, so there is no day to put it on.
  • UnreadableTitle — its SUMMARY is blank, too long, or made of characters that render as nothing.
  • UnreadableIdentifier — it names no UID, or one this deployment will not hold.
  • UnknownTimeZone — a TZID on its start or its end names a zone this deployment does not carry.
  • EndNotAfterStart — its end is not after its start.
  • DateOutOfRange — its start, or its start plus its DURATION, names an instant no calendar here can hold.
  • AlreadyOnTheCalendar — this calendar already holds an event under that identifier.
  • RepeatedInTheFile — the file names that identifier more than once, and only the first of them is read.

Each arrives as a count, never as the entries themselves: which eight entries recur is a list of somebody's appointments, and that eight of them do is what a person deciding needs.

Importing the same file twice creates nothing the second time. Every entry carries a UID, an imported event keeps it, and an entry whose identifier this calendar already holds is counted under AlreadyOnTheCalendar instead of being written again. It is the calendar's own identifier rather than a global one, so a file somebody else imported says nothing about this person's.

What is written is asserted, and the import is one transaction. Choosing a file and confirming what it holds is a person putting those events on their calendar, so nothing an import produces is a proposal; the events carry no reminders and cite no message. Either every event the answer names is on the calendar or none is, so a file that fails part way through leaves nothing to find and undo. The answer carries counts rather than events — the calendar is read back afterwards through its own window, which is the one place events are drawn from.

The file is bounded twice, and both refusals say so. Octets over 1 MB are answered 413 naming the bound, and a file naming more than 500 entries is answered 400 and refused whole rather than partly written — a person confirming a summary is deciding about everything the file holds, and a truncated import would be one they were never shown. A request carrying no body at all, and one whose octets are not iCalendar this deployment can finish reading, are both 400 naming what to do instead. No refusal echoes anything the file carries.

What these routes do not do. They do not export — the other direction is not opened here. They do not read an .ics that arrived as a message attachment, and they answer no invitation: METHOD:REQUEST and METHOD:REPLY are ignored, nothing replies to an organizer, and no ATTENDEE, ORGANIZER, ATTACH, URL, DESCRIPTION, or LOCATION an entry carries is read at all.

The Discover routes

A question about the mailbox takes as long as a model and a mailbox take, so it is asked on one route, read on a second, and stopped on a third. The first answers as soon as the question is known to be answerable, with the run's identifier and the address it is read at:

POST /api/client/discovery/runs
Content-Type: application/json

{ "question": "which supplier quoted least for the racking", "folders": ["role:Inbox"] }
202 Accepted
Location: /api/client/discovery/runs/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90

{ "runId": "0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90" }

The second reads the run from wherever the client has got to. since is the last sequence it holds, and what comes back is whether the run is still going and every event after it:

GET /api/client/discovery/runs/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90?since=3
200 OK
Content-Type: application/json

{
  "running": false,
  "events": [
    {"event":"block","runId":"0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90","sequence":4,"block":{ … }},
    {"event":"completed","runId":"0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90","sequence":5,"limitations":[],"coverage":[{ … }],"spend":{ … }}
  ]
}

The third stops the run, and takes nothing:

DELETE /api/client/discovery/runs/0198f4a1-2b6c-7a1d-9f3e-4c5d6e7f8a90
204 No Content

A client is told when to read again rather than polling for it. Every write raises run.advanced over the signal channel, naming the run and the sequence it reached and no part of the answer, so the read above is what a client does when it hears that rather than on a timer. A client with no channel reads on its own interval and is given exactly the same thing.

Stopping reading is looking away; the DELETE is stopping. A client that only stops reading leaves the run calling the provider and reading mail for nobody, so a person who has read enough and wants to stop paying for the rest sends this. The stop is recorded against the run and the replica executing it meets that record as the next write it is refused, so the provider call and the retrieval stop, the run ends as failed with Cancelled, and everything already written stays written. A run that finished a moment earlier answers 204 as well, because whoever asked could not have known.

All three are answered by any replica, because the run and what it composed are rows rather than state beside the connection that asked: the question may be asked of one replica, read from a second, and stopped through a third. A run outlives the connection that asked for it too, so a client that lost its network comes back to the second route with the sequence it holds and is given what it missed; a since that is absent, zero, negative, or names a place this run never reached reads the run from its beginning. The run belongs to the user who asked for it: somebody else's reads as 404 rather than as a refusal, on the reading route and on the stopping one alike. The asking route answers 429 while this person already has as many runs going as they may — eight, counted across the deployment rather than per replica — and 400 naming what was wrong with the question or the mail it named. The Discover run is what each event carries, what a run reports having spent, what bounds a run, and why it is delivered this way.

The Agent conversation routes

A conversation with the Agent is the person's own record, and every route below reads whose it is off the credential: somebody else's conversation answers exactly as one that never existed does. The history is a listing, and one conversation is read from a cursor the same way a Discover run is:

GET /api/client/agent/conversations
GET /api/client/agent/conversations/0199a2c4-5e6f-7a1b-8c2d-3e4f5a6b7c8d?since=4
200 OK
Content-Type: application/json

{
  "title": "Supplier quotes",
  "startedAt": "2026-09-21T09:00:00+00:00",
  "composing": true,
  "entries": [
    {"sequence":5,"entry":{"entry":"status","messageId":"0199a2c4-6a7b-7c8d-9e0f-1a2b3c4d5e6f","status":"Reading the quotes"}},
    {"sequence":6,"entry":{"entry":"block","messageId":"0199a2c4-6a7b-7c8d-9e0f-1a2b3c4d5e6f","block":{ … }}}
  ],
  "moreFollows": false
}

Each entry is handed over as the record states it — its entry discriminator and its members under their stored names — beside the place it was written at, so the order a client draws is the database's. What is handed over is the visible history only. The record also holds what a run did on the way to an answer — each tool it called and what the tool returned, what its first call was charged — and every summary taken when the conversation outgrew MailAnswering:MaxConversationContextTokens; those are read by the service and never by a client. They share the one order, so the places a client receives can have gaps where they stand, and a read skips them in the statement itself: its limit counts visible entries, a cursor never lands on a technical one, and an empty page with nothing following means the client is caught up. composing says an answer is still being written, and moreFollows says more is written than one read returns, at most 250; the client reads again from the last place it was given. The listing returns at most 100 conversations, the ones not archived first and each group the one that moved last first, and every line carries archived — so a listing cut at the bound loses an archived conversation before one the person is working in.

The history is searched the way mail is: by its words and by its meaning, fused. The query travels in the body rather than the address, so it reaches no access log:

POST /api/client/agent/conversations/search
Content-Type: application/json

{ "query": "indexation cap", "limit": 20 }
200 OK
Content-Type: application/json

{
  "results": [
    { "conversationId": "0199a2c4-5e6f-7a1b-8c2d-3e4f5a6b7c8d", "title": "Supplier quotes", "lastActivityAt": "2026-09-21T09:00:00+00:00", "messageId": "0199a2c4-6a7b-7c8d-9e0f-1a2b3c4d5e6f", "sequence": 6 }
  ],
  "retrievalMode": "Hybrid",
  "semanticSearch": "Available"
}

Each result is one of the person's own conversations and the message in it that matched, by its identifier and the place it was written at, best first — a conversation both rankings found ahead of one only one found, and the one that moved last first between two that rank alike. The words are matched against every question, every answer's prose, and every field of a block or an offer; the meaning against questions and answers' prose, embedded when an answer ends. retrievalMode is Hybrid when both were read and Lexical when only the words were, with semanticSearch saying why exactly as the mail search route does — a deployment whose embedding endpoint is unreachable still answers, from the words alone, and a conversation nothing has embedded is still found by them. limit is 1 to 50 and defaults to 50; the query is at most 512 characters, the body at most 4 KiB, and an empty query, a limit out of range, or a member the contract does not name is 400. The client filters nothing: every result is already the person's.

Asking never waits for the answer. The client names the conversation and the message, so the first question of a conversation starts it and a post retried over a dropped connection writes nothing twice:

POST /api/client/agent/conversations/0199a2c4-5e6f-7a1b-8c2d-3e4f5a6b7c8d/messages
Content-Type: application/json

{ "messageId": "0199a2c4-6000-7a1b-8c2d-3e4f5a6b7c8d", "text": "What did the supplier quote?", "scope": { "kind": "Thread", "subject": "0199a2c4-7000-7a1b-8c2d-3e4f5a6b7c8d" } }
202 Accepted
Location: /api/client/agent/conversations/0199a2c4-5e6f-7a1b-8c2d-3e4f5a6b7c8d

{ "messageId": "0199a2c4-6000-7a1b-8c2d-3e4f5a6b7c8d", "runId": "0199a2c4-6a7b-7c8d-9e0f-1a2b3c4d5e6f", "sequence": 2 }

The question and the opening of the answer to it — the run — are written together, and the run's identifier is the answer's. A repeated messageId answers with what the first post wrote. scope is Mailbox with no subject, or Thread, CalendarEvent, or DiscoveryRun naming the one it was asked about, and may be left out. A question asked while an answer is still being composed is 409, and so is one into a full conversation — 5 000 visible entries, or 50 000 entries of the whole record, the last two of each kept for an answer's ending and the agent's note after a stop, so a running answer can always be stopped — and one that would start a conversation for a person already holding 1 000, where deleting one makes room; an empty or over-long text, an empty identifier, or a scope naming no subject is 400.

The answer is composed by the replica that took the question, past the request that asked it. The run reads the person's mail, calendar, and tasks each under the grant that reads it — mailfathom.mail.read, mailfathom.calendar.read, mailfathom.tasks.read — so a caller holding the asking grant without one of them is answered by a model that was not offered that reading at all, writes a status line, each block, and each proposal the moment it exists, and ends as completed, stopped, or failed — so a client that leaves and returns reads everything written meanwhile, and closing the connection ends nothing. It spends from the same period ceiling and per-run bounds a mail answer does, on the model Chat:Agent:Model routes it to; a deployment with no chat endpoint ends every answer as failed rather than refusing the question. A replica that stops mid-answer leaves it failed rather than resumed.

An answer that completed may suggest what to ask next. Its answerEnded entry then carries followUps, at most three lines of at most 120 characters each, in the order the agent suggested them:

{"sequence":9,"entry":{"entry":"answerEnded","messageId":"0199a2c4-6a7b-7c8d-9e0f-1a2b3c4d5e6f","outcome":"Completed","followUps":["Who confirmed the bays?","Draft a reply asking to hold them another week"]}}

The agent composes them on the same run, under the same bounds and the same ceiling, as the answer they follow, and an answer that suggested nothing carries an empty list — as does every stopped or failed one, and an ending written before the member existed carries none at all. Each is text and never an act: a client that offers one posts it as an ordinary question into the same conversation, exactly as though it had been typed, and nothing else happens when it is pressed.

Steering adds to a running answer; stopping ends it. They are different routes because they are different acts:

POST   /api/client/agent/conversations/{conversationId}/runs/{runId}/messages
DELETE /api/client/agent/conversations/{conversationId}/runs/{runId}

An instruction posted into a run — messageId and text, answered 202 as a question is — is added to what the run is composing and taken from its next turn: nothing already composed is touched, and nothing restarts. A run that has ended has nothing left to steer, which is 409. The DELETE ends the run where it stands, answered 204: everything it wrote stays, the answer is recorded as stopped, and the agent writes a line in the person's language saying so and asking where to pick it up. A run that ended a moment earlier answers 204 as well. Both are recorded rather than delivered to the replica composing the answer, so either works through any replica and while the hub is down — the run meets a stop as the next write it is refused.

A proposal is accepted or declined by the place it was written at, and accepting carries out exactly what was proposed:

PUT /api/client/agent/conversations/{conversationId}/proposals/7
Content-Type: application/json

{ "decision": "accepted" }

The answer is 200 with the place the decision was written at, 400 for any decision but accepted or declined, and 409 where there is no proposal at that place this person can answer that way — none offered, or already decided — which is also what a second press gets, so an act is never carried out twice. Accepting is recorded first and the act carried out after it — a message sent, or an answer to a message sent, through the same drafting and sending a person composing it by hand goes through — and an act this deployment refuses ends the proposal as failed, which is what the conversation then shows. The one decided proposal that can still be answered is a failed one, and only by accepted, which is how it is tried again; declining a failed proposal is 409, as is answering a declined or an accepted one either way. A caller whose grant does not carry every permission the act needs — mailfathom.mail.drafts.write and mailfathom.mail.send for a message, mailfathom.mail.read as well for an answer to one, mailfathom.calendar.write for an event, and mailfathom.tasks.write for a task — is 403 before anything is recorded. Declining carries nothing out. DELETE /api/client/agent/conversations/{conversationId} removes the conversation and everything said in it, 204, and 404 once there is nothing to remove.

Archiving puts a conversation away without losing any of it:

PUT    /api/client/agent/conversations/{conversationId}/archive
DELETE /api/client/agent/conversations/{conversationId}/archive

The PUT archives the conversation and the DELETE restores it, each answered 204, and 404 where this person holds no such conversation. Either answers 204 when the conversation is already where it was asked to be. Archiving is a state of the conversation the deployment keeps, so it follows the person to every client they sign in on, and it changes where the conversation is listed and nothing else: every entry stays, it reads, answers, and deletes as it did, an answer still being composed in it goes on being composed, and it does not move the instant the history is ordered by. Nothing archives a conversation on its own.

Every visible write is announced as run.advanced over the signal channel, naming the conversation, the run where the write belongs to one, and the place reached — never the question, a block, a status line, or a title. A client reads the conversation from its cursor when it hears one, on mount, and after every reconnect, so a client with no channel loses latency rather than any of the conversation. ADR 0035 is why it is delivered this way, and the schema what the record holds.

The telemetry routes

These three are an OTLP receiver, served for the client's own instrumentation and for nothing else. A client exports to /api/client/telemetry the way it would export to a collector — the paths beneath it are the OTLP specification's own, so the exporter is pointed at the prefix and appends nothing — and what it sends is forwarded to wherever this deployment already exports its own telemetry.

Route What it takes
POST /api/client/telemetry/v1/traces One ExportTraceServiceRequest as application/x-protobuf
POST /api/client/telemetry/v1/metrics One ExportMetricsServiceRequest, same encoding
POST /api/client/telemetry/v1/logs One ExportLogsServiceRequest, same encoding

A deployment that named no collector does not serve them at all. The routes are mapped only where OTEL_EXPORTER_OTLP_ENDPOINT is set, so a client exporting to a deployment that exports nothing is answered 404 and learns from the answer rather than from a setting it would have to be told about. That is the same shape the rest of this surface uses for an endpoint that is off, and it is what keeps the default a privacy default: a deployment that decided its own signals stay in the process does not become a relay for somebody else's.

The log route takes nothing from a caller asked for no log records. Where a caller's level resolves to None — the deployment's ClientEndpoint:TelemetryLevel, or their own record's ClientTelemetryLevel in front of it — POST /api/client/telemetry/v1/logs answers 403 and forwards nothing, before the batch is read and without spending any of that person's export rate. It is the resolution the session route answered them with, so the level a client is told and the level the deployment holds are one, and a client that sends a batch of log records regardless of what it was answered still reaches a collector with none. It is not what stops a client built before the value existed: that one treats none as off and sends nothing to any of the three routes. 403 is a status an OTLP exporter does not retry, so nothing is held for a batch that will not go. The traces and the metrics routes are unaffected by any level.

All three take nothing from somebody whose telemetry switch is off. The switch is telemetryEnabled on the preferences routes, read as those routes answer it: what a settings policy forces where one holds it, and the person's own answer otherwise, which is on for somebody who never gave one. Where it is off, every route answers 403 and forwards nothing, before the batch is read and without spending any of that person's export rate. So a refusal is something the deployment keeps rather than something it asks a client for, whether the person refused or a policy holds the switch off, and a client that exports regardless reaches a collector with nothing. A policy forcing the switch on takes what a client sends whatever its holder stored, and compels nothing: a client that sends no batch is refused none. It raises nothing else either — not the level a client is asked for, and not a collector this deployment never named. A stored answer that cannot be read as a preferences document is treated as a refusal, since taking nothing is the reading that says least about its holder. So is every batch from somebody whose record this replica does not serve: their credential still authenticates while the record is held back, what a policy forces for them cannot be known there, and reading their own answer instead would lift a forced off for exactly the people whose governance did not resolve.

They authenticate exactly as every other route here does, on this surface's own credentials, and they add no name to the published permission set — like the session route, and for a narrower reason: a permission would have to be granted to every client that reports anything, which makes it a component of every grant rather than a decision anybody takes. What the credential does decide is whose telemetry this is. The resource attributes naming the user are written here from the authenticated credential and replace whatever the client put in their place, so a page cannot report as somebody else however its bundle was modified. Nothing else in the payload is transformed: the batch is forwarded as it arrived, so a signal a client's own instrumentation names arrives at the collector under that name.

A refusal here offers no password challenge, which is the one way their 401 differs from every other route's on this surface. A route a person reaches answers with the Bearer challenge and a Basic one beside it, because a username and a password are typed by somebody whose client only asks for them when a challenge tells it to. Nobody navigates to these three: the caller is the client's own OTLP exporter, which builds its own fetch with an Authorization header it was constructed with and no credentials mode, so the browser is left holding a Basic challenge on a request made from a page that is already signed in — and what a browser does with one is open its own sign-in dialog over whatever somebody was reading. So the refusal carries the bearer challenge alone, under the same MailFathom realm as everywhere else, and the exporter is unaffected: it reads the status rather than the challenge, and a credential that has expired is renewed by the page rather than retyped into a dialog the page cannot see.

Read attribution off the resource, which is the level this holds at. A client is free to write anything into a span, a log record, or a metric data point, a key spelled like the user one included, exactly as it is free to write anything into a span's name — those are its own words about its own work, they are forwarded untouched like every other field it sends, and nothing here reads them. Reaching them would mean decoding all three signals against their schemas, which is what would make this a processor rather than a proxy. So a dashboard, a query, or a retention rule that has to know whose telemetry it is reads the resource attribute, and that one is the deployment's own and cannot be influenced from a browser.

What it forwards to is the deployment's, never the client's. There is no second destination setting, and the collector's address and its credential never leave the process — a client holding either would be publishing them to whoever opened the developer tools. The endpoint, the protocol, the headers, and the per-export timeout are the ones the deployment's own exporter reads.

Everything is bounded, per credential, and a refusal names the bound rather than truncating the batch:

Bound What it is What a client is answered
Request body 4 MiB 413, carrying the specification's own status message
Records in one batch 10 000 spans, metric points, or log records 413, with nothing forwarded
Export rate 120 requests a minute for one signed-in person, and the same again for the next 429 with Retry-After: 60

A batch the endpoint cannot read as a protocol-buffers export request is answered 400 and forwarded nowhere: a deployment's collector is not the place to find out whether a client's encoder works. A collector that answered a partial success is relayed verbatim rather than reported as a success, because a client that was told everything arrived stops holding what did not. A collector that refused the batch outright is answered in this endpoint's own words instead: what it said is about this deployment's own export — a version it does not speak, a message it could not read — and is not a document to hand to a browser. Anything transient — a collector that is down, unreachable, slower than the configured timeout, or refusing this deployment's own collector credential — is answered 503, which is what leaves the batch where the client can still send it again. That last one is a deployment fault rather than a client one, so it is reported to the operator as its own condition rather than folded into the others.

Accepting and forwarding writes no log record at any level. A signed-in client exports every few seconds for as long as it is open, so a line per batch would make a deployment's own logs unreadable within a day. A forwarding failure does write one, aggregated per condition rather than per batch and repeated at most every five minutes, naming the condition and how many batches it has cost since it was last reported; it carries no part of a payload. What the proxy accepted, refused, forwarded, and failed to forward is reported as metrics instead, which is where a rate belongs.

A browser reaches them under the origins this surface already declares. The preflight is answered from the same list every other route here is served to, and no origin is admitted here that the rest of the surface refuses.

The signal channel

A client that is open is told what changed rather than left to find out on its interval. The channel is one SignalR hub beneath this surface's prefix, it carries statements in one direction — from the deployment to the client — and it declares no method a client can call: a client still acts over the routes above, which is where its permission is judged, its request is bounded, and its act is recorded.

Route What it does
POST /api/client/signals/ticket Mints the single-use ticket a connection is opened against
/api/client/signals The hub itself, reached over a WebSocket carrying that ticket

The hub serves WebSockets and nothing else. A server-sent-events or long-polling connection is refused to every caller, and the client never asks for one: it opens the connection with negotiation skipped, which makes the whole handshake a single request rather than a negotiation followed by the transport it chose. That is what removes every reason for session affinity — there is no pair of requests for a load balancer to keep together, and the one request that opens the connection is the one that presents the ticket. What it costs is stated rather than discovered: a network or a proxy that will not pass the WebSocket upgrade gives that client no live updates at all, and the client reads its screens over the ordinary routes on its own schedule instead.

A connection is opened against a ticket, because a browser cannot put a header on a WebSocket. The client mints one over the route above — an ordinary authenticated route on this surface, published under mailfathom.mail.read like the mail it announces and asking for mailfathom.notifications.read beside it, because one of the lines the channel carries is a notification's own headline — and hands it to the connection. A caller missing either grant is answered 403 naming it and holds no ticket, so its client reads its screens over the ordinary routes on its own schedule. A ticket names the user the credential behind it already named, is drawn from a cryptographically secure source, lives 30 seconds, and stops working the first time it is presented, so one read out of a proxy's access log or a browser's own history is already spent or already expired. Nothing else opens a connection: a connection presenting nothing, something malformed, something expired, or something already spent is closed without being told which.

The deployment holds its unspent tickets in PostgreSQL, so any replica accepts a connection any other replica minted a ticket for. Minting is one insert and spending is one statement that removes the row and hands back what it held, so exactly one presentation of a ticket wins whichever replica each of them reaches. What the row holds is the user, a digest of the ticket's secret half, and the expiry — never the secret itself, so a row read out of the database or out of a backup opens no connection. The ticket does not live in the signal backplane, because that component is optional and an authentication path must not depend on one: a deployment running no backplane loses signals between replicas and never loses connections. A deployment that cannot reach its database refuses the connection rather than admitting it, and says so in its log as an outage rather than as a ticket that was wrong.

One user's signals reach that user's connections and no other's. A connection joins a group named from the user's own identifier the moment it is admitted, and every statement is published to one group; nothing here reads a group name a caller supplied, because nothing here takes one.

What crosses is what changed, never what it changed to, with two named exceptions. A signal is an instruction to look again: it names a count, an account alias, a folder alias, a stored identity, and the two server flags of one, and no subject, address, body fragment, filename, or attachment name reaches it at any size. The first exception is the flags mail.flags.changed carries, which say where each of those two stands rather than that one moved, for the reason the paragraph below the table gives. The second is a raised notification's own headline and second line, which are the record's already-derived text and reach a client entitled to read that record over the notification routes. Seven things are said:

Signal What it says
mail.arrived A run committed mail into one folder, and how much
mail.changed Stored mail in one folder is no longer what a client last read, naming up to 100 of the rows
mail.flags.changed Nothing moved but the \Seen or \Flagged flag of up to 100 rows, and where each of those flags now stands
folders.changed The set of folders an account mirrors, or a held account's local folders, has moved
notification.raised A notification was written, with its kind, its two lines, and how many now stand unread
account.state An account's synchronization run finished, so what a client says about it is out of date
run.advanced A Discover run or an Agent conversation had something written, naming the run, the conversation where it is one, and the place reached — and no part of what was written

A flag is the one change stated rather than pointed at. mail.flags.changed carries, per row, the stored identity and where each of the two flags now stands, so a client redraws the row it already holds without reading the page it is on — which is what makes a star or a read mark land on the screen without a round trip behind it. It is safe for those two values alone: applying the same statement twice is the same state, and a flag never moves a message between folders or in or out of a filtered view, so no reader has to decide whether the row still belongs where it is drawn. Anything else that moved — a message that changed folder, was deleted, or whose keywords moved — says mail.changed for the whole of what a run found, and a client re-reads. A flag a publisher did not observe is left out rather than reported as cleared: a reconciliation window states both, and a change this deployment authored states the one it wrote.

A client that does not know a kind ignores it and catches up on its next refresh, which is what made the sixth and the seventh additions rather than breaks; the client and the service ship under one version.

A settled move says mail.changed twice, once per folder. A change that files a message somewhere — a move, a copy — changes the folder it left and the folder it landed in, so both are named, and a client watching either re-reads when the message crosses rather than when something else makes it look again. The destination is named by its alias, so a move into a folder this deployment maps and does not mirror announces the source alone: there is no folder a client holds mail for. Everything else — a delete, a keyword change — names the one folder the message is in, exactly as before, and a settled flag change says mail.flags.changed about that one folder instead.

The folder a message landed in is named a second time once a run has carried it there. The settled move is announced when the mail server has taken it, which is before the account's next run finds the message in its new folder and moves the stored row with it — so a client re-reading on the first statement reads a folder that does not hold the message yet. The run that carries it says mail.changed for the landing folder again, naming the messages it carried, and that is the read that finds them. A client holding none of the named rows reads the folder's leading page again, as it would for an arrival.

Statements are folded per user, per kind, and per place over half a second. A run committing a folder's worth of mail is one arrival to the person who was away from the screen rather than one statement per message, and two folders' arrivals stay two statements so a client is never told that mail arrived without being told where to look.

A client with no channel behaves exactly as one that never had it. Every screen re-reads over the routes above, and the channel only decides when. So a deployment behind a reverse proxy that does not pass the WebSocket upgrade, or one whose client could not connect for any other reason, serves the same client with the same data on the client's own interval; the client says nothing about a channel that is merely down. It reconnects on a jittered backoff that stops growing at thirty seconds and never stops while somebody is signed in, and it tries at once when its window comes back to the front or the browser reports its network back.

A client catches up on what it could not be told. Nothing buffers a statement for a connection that is not open, so a gap in the channel is a gap in what the client heard — a dropped socket, a rolling upgrade, a network that went and came back, and, above one replica with no backplane configured, a statement lost behind a connection that stayed open. So the client refreshes: it reads again everything it draws — the folder tree and its counts, the pages of the list it holds, the open message, the accounts, and the notification centre — whenever a connection stands again after one stood for the same sign-in, and every five minutes while its window is visible, counted from the last refresh rather than on a fixed clock. It never refreshes while the window is hidden, and refreshes at once when a window hidden past those five minutes comes back. A refresh is the act the client's Refresh control performs, it keeps what the person is in the middle of — the selection, the open message, where they are in the list, and any change still pending — and one the deployment does not answer leaves what is drawn in place for the next to try again.

Fanning signals across replicas

One replica's hub reaches one replica's connections. A signal is published to the connections the process that raised it is holding, so above one replica the arithmetic is unkind: the replica that synchronized an account is the one #1290 gave the account to, the connection that has to hear about it is wherever the browser's socket landed, and those are the same process only by chance. What the client sees is a channel that stands open and says almost nothing, which is worse than one that is plainly down: the client falls back to its five-minute refresh either way, but nothing an operator reads says the fan-out is the reason.

A RESP endpoint closes that gap, and it is optional. Writing SignalBackplane makes every replica publish each statement to that endpoint and subscribe to what the others publish, so a signal raised anywhere reaches a connection held anywhere. A deployment running one replica writes nothing and loses nothing. A deployment serving no client surface fans out no signal whatever it wrote, because the hub's use of the backplane is registered inside the client surface's own composition; it still connects, to hear a committed configuration change announced.

The contract is the protocol, not a product. MailFathom reaches the endpoint through StackExchange.Redis and asks it for PUBLISH, SUBSCRIBE, and PSUBSCRIBE and nothing else — no key is written, no key is read, and no command outside that set is issued — so any RESP endpoint serves: Redis, Valkey, Garnet, or a managed equivalent from a cloud provider. An operator who already runs one names it in the connection string and MailFathom starts nothing beside it. What the project itself deploys, pins, and tests against is Valkey: the Helm chart, the Compose file, and the Quadlet units all ship it, and each of the three can be told to deploy nothing and point at an endpoint you operate instead. The local orchestration ships it too and offers no such switch — it either starts one for the run or starts none. That is a default rather than a requirement, and the three deployment pages each say where the choice is made.

What it costs when it is not there, or when it breaks, is exactly what the paragraph above describes and no more: the channel degrades to the client's own refresh. The connection is opened so that an endpoint that is down at startup does not stop the host from serving, a lost or regained connection is logged at Warning and counted rather than failing a readiness probe, and nothing is buffered for a replica that was not listening — a statement is an instruction to look again, and the next refresh is the catch-up.

Only what a signal already carries crosses it, plus the name of the group it is addressed to. The backplane transports the same payload the hub would have sent over the WebSocket: a kind, a count, an account alias, a folder alias, stored identities, the two server flags, and a raised notification's own two lines. No subject, address, body fragment, filename, or attachment name reaches it, for the same reason none reaches the connection. One value crosses that the payload deliberately leaves out: a statement is published on a channel named after the group it is for, and that group is named from the user's own identifier — so the RESP server sees a stable per-person identifier on every statement and on every subscription, where a connection is told only what changed. It is an identifier this deployment generated rather than an address or a name, and nothing on that server resolves it to a person. All of it is personal data in transit: an account alias, a folder alias, a notification's headline, and that identifier are about a person, and a RESP server sees them. It is stored nowhere — publish and subscribe keeps no message, this deployment sets no key, and a replica that was not subscribed at the moment is simply not told — so there is nothing on that server to retain, export, or erase, and nothing about it enters a data-subject workflow.

Keep it inside the deployment's trust boundary, and secure the transport when it is not. The intended shape is a RESP server on the same network as the replicas, reached over a private address and by nothing else. The Helm chart renders one on request — a Valkey StatefulSet published as a ClusterIP Service, which is that shape, optionally with standby instances beside it — and takes an address an operator already has instead when they turn that off. The local orchestration starts one for a development run. Pointing the section at a managed endpoint outside that boundary makes the transport the operator's obligation: reach it over TLS by writing ssl=true in the connection string, give it a password and let secret provisioning carry that, and restrict the endpoint to the addresses the replicas answer from. A clear-text RESP connection across a network somebody else runs publishes those aliases to whoever is on the path, and nothing in MailFathom can tell one network from another.

What the credential and the address restriction guard is injection as well as disclosure. Anything able to write to the endpoint can publish onto the channel named for a user, and the replica holding that user's connections forwards what arrives — including a raised notification's headline and second line, which are free text a person reads. So a RESP server shared with something else, even inside the deployment's own network, is one whose other writers can put a statement on somebody's screen; what keeps that from being true is the same password and the same address restriction, rather than an additional measure.

A proxy in front of this endpoint has to pass the upgrade — Upgrade and Connection on the request, and no buffering or idle timeout shorter than a connection that is meant to stand open. Nothing here fails when it does not; the client falls back to its interval, which is what makes this safe to deploy behind a proxy nobody reconfigured.

It needs no session affinity, at any replica count, and configuring it anyway gains nothing while pinning load: a cookie pins every request a client makes and hashing the source address puts every client behind one NAT on one replica, both of which distort the load the replicas were added to share.

The hub is deliberately outside this surface's request timeout and rate limiter, and the minting route is deliberately inside both. ClientEndpoint:RequestTimeout would abandon a connection meant to stand open at the same bound it abandons a request for a page of mail, and ClientEndpoint:RateLimiting would count an open connection against the capacity a browser is spending reading mail. What is bounded instead is the minting, which a reconnect cannot avoid — and a deployment holding as many unspent tickets as it will hold answers 503 rather than growing. That ceiling is the deployment's rather than each replica's: it is counted in the same statement that writes the ticket, so raising the replica count does not multiply it. A deployment that cannot reach those tickets at all answers the same 503 on the same route, because what a client does about either is identical — wait, and mint again. The two are told apart by the error code the answer carries: 33002 is the database that could not be asked, and the ceiling carries none. An operator meeting 33002 is looking for an unreachable database rather than for ten thousand unspent tickets, and the log entry the refusal wrote is where that failure is. What bounds the other end is the hub itself, which has authenticated nothing when a connection arrives: a value without the shape of a minted ticket is refused before any statement runs, and each replica has only so many redemptions in flight at once, sized well below the connection pool the rest of the deployment reads mail through. A flood of handshakes therefore costs live updates while it lasts and never costs mail, because the client's own refresh is what the screen is promised on.

The connection is served only where this endpoint is. The hub sits beneath this surface's route prefix, so a listener that does not serve the client surface answers it 404 exactly as it answers every other route here, and a deployment with ClientEndpoint:Enabled unset serves no hub and holds no ticket.

Credentials do not cross surfaces

A key admitted under McpEndpoint or AdminEndpoint authenticates nothing here, and one admitted here authenticates nothing there. The separation is mechanical rather than conventional: each surface registers its own authentication schemes and its own authorization policy, and a policy consults only its own schemes.

Authentication takes the same entries the MCP section takes — one entry per accepted method, each naming a Method of password, api-key, public-key, or oauth-subject — and every method is documented once, under the MCP endpoint. The credentials themselves are rows beside the user rather than settings here, and one credential is presented on whichever surface accepts its method; what keeps the two apart for a signed assertion is the audience it names, urn:mailfathom:client, so an assertion minted to read a mailbox as an agent cannot sign in as somebody's mail client.

Whether a person reaches this endpoint at all is their own switch rather than their credential's. Each user carries one switch for this endpoint and one for the MCP endpoint, both on until mfctl user endpoints --client false turns this one off. A user kept off it is refused here whichever credential they present, with the same 401 a credential nobody holds receives: the exchange mints them no session, and a session they already hold stops working on their next request, on every replica, because the switch is read beside the session on each one. Nothing is revoked, so turning the switch back on serves the sessions they still hold. The switch decides where somebody is served and the grant decides what they may do once they are; neither widens the other, and an automation account kept off this endpoint still reads mail over MCP with exactly its grant. What a permission does not decide holds the whole rule.

Two things the switch does not reach. A signal connection already open stays open: it was admitted against a ticket when it connected, and nothing is re-judged on a connection that is already carrying statements — so the client goes on being told that something changed until the connection closes, while every route it then calls to read what changed is refused, and no new ticket is minted for them — though a ticket minted just before the switch moved still opens a connection until it expires, thirty seconds after it was minted. And this endpoint configured to require no credential judges no switch, because a request presents nothing that names a user and every one is served as the single user the deployment holds; keeping somebody off it means configuring a credential for it, or disabling it.

What a caller here may do is what its user's roles grant, kept to the names its credential records rather than anything on the entry. Those names draw from the user-facing half of the published set — a name reaching only the administrative half is refused where the credential is provisioned. Writing a grant and how a caller's grant is computed are the whole of that rule; nothing about it is particular to this surface.

Signing a person in

Two of the four methods sign a person in rather than a client, and which of them a deployment offers is what it configures.

Whichever it is, it is presented once — to the exchange — and the client presents the session it was given afterwards.

A username and password is what the client's own sign-in screen asks for. A deployment that runs no authorization server reaches for it; the entry names the method and the credentials are provisioned over the administrative endpoint:

{
  "ClientEndpoint": { "Enabled": true, "Authentication": [ { "Method": "password" } ] }
}

The method is documented once, under the MCP endpoint — including the bound on guessing, the indistinguishable refusal, and what this surface's transport does to it: a password crossing a clear-text hop is reported at every startup and never refused, naming this surface and its port, because this process can read the scheme of its own socket and nothing beyond it. A loopback deployment behind nothing, and a public socket nobody meant to expose, are one reading from here.

A caller admitted this way acts for the user the credential belongs to, and so does every other method here: each of the four resolves a record beside one user. That is what lets one deployment serve more than one person's mail over one address.

An access token is the other, and it is what a deployment that already runs an authorization server uses. MailFathom is a protected resource only — it signs nobody in, holds no user, and issues no token — so what a deployment configures here is which authorization server's tokens are believed, and each person's subject is mapped onto their user record with mfctl credential create --method oauth-subject.

Every OAuth entry must name a Resource ending in /api/client. Startup refuses anything else, naming the setting. The reason is discovery rather than OAuth: the client is configured with an address and finds the protected-resource metadata document by appending the prefix it is about to call, which reaches the document's RFC 9728 location exactly when the resource names the same prefix. It matters more here than on the administrative surface, because the reader is given an origin and nothing else — the client refuses an address carrying anything beneath one — so every other address it uses is one it derived rather than one anybody could correct.

The document is published at the root, beneath /.well-known/oauth-protected-resource, and it follows its surface: it answers on the client listener and is 404 on any other. It is served to a caller holding nothing, which is the whole point of publishing one — its reader has not authorized yet and is trying to find out where to.

GET /.well-known/oauth-protected-resource/api/client

Behind a reverse proxy, write the public URL and keep the path: https://mail.example.test/api/client. What a token must prove, and why the advertised scope list is longer than the checked one, is under the MCP endpoint; none of it differs here.

What a sign-in screen is offered

Both methods above are what an operator configures; this is what a person meets. The client asks the sign-in methods route before it draws anything, and every part of the screen follows what came back independently — so the three postures below are what a deployment produces rather than modes it selects.

What is configured What the screen shows
a password entry alone The username and password form, and no provider control
an OAuth entry whose servers carry a ClientId, and no password entry A control per published server, and no form — which is what makes a token-only deployment a screen somebody can use rather than a form nobody can submit
both The self server's control at the top where one is published, the other servers beneath it, a divider, and the form under that

A deployment that publishes neither — every entry api-key or public-key — is told so on the screen rather than shown an inert form. An endpoint configured with no entry at all is not that case: it publishes acceptsPassword true for the reason above, and the screen it draws is the password form.

The flow is an authorization code with PKCE and nothing else. The client reads the server's own discovery document from its issuer, generates a verifier it keeps and a S256 challenge it sends, and starts the request with the published client identifier, the resource the protected-resource document names, the scopes that document advertises — offline_access among them is what gets a refresh token issued — and a single-use state, plus a nonce where the server is an OpenID provider. No client secret exists anywhere, which is why the identifier above is publishable: the verifier is what the redemption proves, and it is never stated in any address.

The protected-resource document is read against the deployment being signed in to. A document naming a resource other than that deployment's own /api/client is refused and no provider control is drawn, which is RFC 9728 §3.3 — so the Resource an operator writes is the absolute address clients reach this endpoint at, exactly as the setting's own validation says. And the flow needs TLS in front of the page: a document served over plain HTTP is an insecure context, where the browser offers no digest to compute the PKCE challenge with, so a deployment somebody permitted clear text for offers the password form and reports the provider as unreachable rather than drawing a control that goes nowhere.

Register the redirect address before anybody signs in, because each is compared exactly by the authorization server. The web head comes back to the address of the page itself — https://mail.example.test/app/ where a deployment serves the bundle — and the desktop head comes back to http://127.0.0.1:8766/, a loopback address its own shell listens on for as long as one sign-in is in flight and then stops. Register whichever heads your people use; a server holding neither refuses the authorization request at its own screen rather than refusing the token afterwards.

What the deployment then does with the token is judge it as an oauth-subject credential, exactly as it judges one an agent presented: the subject is mapped onto a user record with mfctl credential create --method oauth-subject, and a token whose subject is mapped to nobody is refused with an empty 401. MailFathom mints nothing and serves no login page in any of this — the person authorized at the operator's own server, and this endpoint is a protected resource throughout.

The access token is renewed before it expires, and signing out asks for the refresh token to be revoked. The client presents the refresh token it is holding and takes whichever one comes back, so a server that rotates them is followed rather than re-authorized; a refused refresh ends the sign-in, while a server that could not be reached at all is retried. Signing out clears the session and the grant together, on the head's own terms, and asks the authorization server's revocation endpoint to withdraw the refresh token — asked without waiting on the answer, and asked of nothing where the server publishes no such endpoint. ADR 0023 is where a grant is kept and what clears it.

Browser origins

Every MailFathom head calls this surface from an origin, and a preflight this endpoint cannot answer is a client that never starts. The same setting exists on the MCP and administrative endpoints, configured separately.

ClientEndpoint:Cors:AllowedOrigins What the endpoint answers
absent Every browser origin
["*"] Every browser origin, stated
["https://mail.example.test"] Exactly the origins listed
[] No browser origin, which still serves every client that sends no Origin

The permissive default is deliberate, for the reason the MCP endpoint's is: a surface is protected by the credential a caller presents rather than by which page it was called from, and a first run that failed a preflight would look like a broken deployment. Narrow it to the origins your own heads are served from once you know what those are — the next section is what a downloaded one sends.

The empty list is the third posture rather than an oversight, and it fits exactly one deployment: the one whose only client is the page it serves itself. That page is same-origin, so it is never subject to CORS at all and goes on working while every other browser origin is refused; so does every non-browser caller, which sends no Origin. It does not fit a deployment reached by a downloaded head, which sends an origin of its own and is refused by it.

The origin a downloaded head sends

A desktop or mobile head is not exempt from CORS. Both render in a webview — WebKitGTK or WebView2 on the desktop, Chromium's on Android — which enforces CORS exactly as a browser does, against the origin the shell served the bundle from. That origin is never the deployment's, so it is named here or the head is not served:

The head The origin it sends
The desktop head on Linux tauri://localhost
The desktop head on Windows, and the Android head http://tauri.localhost

Both are accepted as entries. The custom-protocol one is the reason this setting takes a scheme beyond http and https at all: without it, the only posture that served a Linux desktop head was ["*"], which is every origin on the internet rather than the one head an operator meant. Nothing else is accepted — a scheme MailFathom serves no head from is a startup error naming the entry rather than a line that binds and then matches nothing.

{
  "ClientEndpoint": {
    "Cors": {
      "AllowedOrigins": [
        "https://mail.example.test",
        "tauri://localhost",
        "http://tauri.localhost"
      ]
    }
  }
}

A refusal here does not look like a refusal. The response carries no Access-Control-Allow-Origin, so the webview rejects the fetch before the client sees a status, and nothing reaches this endpoint's logs — the head reports that the deployment did not answer, on its sign-in screen, before a password has been typed. A deployment whose page signs in while a downloaded head calls it silent is this setting before it is anything else.

The policy allows GET and POST, the Authorization, Content-Type, Accept, and traceparent request headers, and exposes WWW-Authenticate so a page can read the challenge that tells it where to authorize and Retry-After so a client told to hold can read for how long. traceparent is the W3C trace context the client sends on every request, and it is the only propagation header this surface admits — what a client-originated trace contains is what it carries and why nothing else is allowed beside it. Credentials are never allowed under any of the postures above: a browser that could attach an ambient cookie would let a page act as whoever is signed in somewhere else, and this surface's credential is a bearer token the client sets deliberately.

What bounds the traffic

ClientEndpoint:RateLimiting and ClientEndpoint:RequestTimeout carry the same keys, defaults, and validation the other two surfaces carry, and are configured independently of them: neither one's traffic reaches another's limits. Both apply whether or not anyone wrote a number, which is what stops a surface reachable from a page from serving unbounded key guessing.

A user's every credential spends that user's one allowance here. A signed-in session, a password, and a key held by the same user draw on one bucket and one concurrency allowance, and a colleague's traffic draws on theirs, so the endpoint behaves the same for a roster of twenty as for one person; whose capacity a request spends is the rule.

The MailFathom client keeps to the defaults on its own. It holds at most six requests in flight, under the eight at once the default allows one user, so signing in and drawing every space is refused for nothing. A request the limiter still refuses — a second window signed in as the same person, or a deployment configured narrower than the default — is sent again up to three times, after a spread wait or after the Retry-After the refusal named, and only a refusal that outlasts those attempts reaches the screen as a deployment that did not answer. Narrowing MaxConcurrentRequestsPerUser below six therefore costs the client a slower start rather than a failing one, and a Retry-After longer than ten seconds is reported at once rather than waited out behind a spinner.

A deployment that is briefly away costs a reader a short wait rather than a failed screen. A read answered 502, 503, or 504, or met by a connection refused or dropped, is sent again on the same schedule and honours a Retry-After on any of them — so a restart or a rolling upgrade that a proxy in front of the deployment answers for with 503 and a Retry-After of a few seconds is waited out rather than reported. A write is not: none of these proves that the first attempt was not acted on, so a write is sent again only after the limiter's 429, which does. The spread between attempts is what stops a fleet of clients that lost one deployment from returning to it in step.

Both are attached to this surface's routes rather than applied as the process's default policy, which is what keeps the health probes answering while the client endpoint is refusing. A default limiter would count a readiness probe against the same capacity a browser is spending, and a deployment under load would start failing the probe that decides whether it is taken out of service.

Neither reaches the signal channel's hub, which is mapped outside this surface's route group for that reason, and both reach the route that mints its tickets — so a client reconnecting in a loop is bounded by the minting it cannot avoid rather than by a timeout on the connection itself.

What travels compressed

A response is compressed when the request offered an encoding this deployment can produce, and is served unchanged when it did not. Nothing configures it: there is no key, no switch, and no per-route opt-out. A caller that sends Accept-Encoding: br, gzip is answered with content-encoding: br, one that offers gzip alone is answered with gzip rather than with an encoding it cannot read, and one that offers neither is answered with the bytes it asked for. Every compressed response carries Vary: Accept-Encoding, so a cache in front of the deployment keeps one body per encoding rather than handing a Brotli page to a client that never offered it.

It matters most where it is least visible from: a hundred-row mail list is around 75 kB of JSON that repeats its own field names, and it travels several times smaller than that. On a local or intranet deployment the difference is nothing; on a phone it is most of the time a folder takes to open.

What is compressed is JSON, text, XML, CSS, JavaScript, and WebAssembly, which is the framework's default set. Everything else travels as it arrived, which is what keeps an attachment or a portrait from being compressed a second time: a JPEG, a PDF, and a ZIP are octets somebody else already compressed, and a pass over them costs latency to produce a slightly longer body. The signal channel is excluded as well, for the reason the limits and the ceiling exclude it — what travels there is a connection rather than a response — and so is the route that mints its tickets, which is the one answer here that is itself a credential and is a couple of hundred bytes either way.

This is the client endpoint alone. The MCP surface and the administrative surface serve their responses uncompressed, and whether they want the same treatment is a separate reading rather than an oversight.

It applies over HTTPS as well as over clear text, which the framework does not do by default, because compressing a response over TLS is what BREACH exploits. The attack recovers a secret from a compressed body by watching how the body's length moves as an attacker-chosen string is reflected into it, and it needs the victim's browser to attach a credential to a request the attacker caused. This surface authenticates by header — the token, key, or assertion the page attaches itself — and never by cookie, so a cross-site request arrives here with no credential and is answered as an anonymous one. Nor does any response here reflect a caller-supplied value back: the search route is the closest and deliberately does not echo the query it was asked, and the refusals that do quote a caller's value are served as application/problem+json, which is outside the compressed set above.

Transport security

The surface takes the same Transport setting the other two do, with the same three modes and the same clear-text redirect — see Transport. It is Http by default, which is right behind a TLS-terminating reverse proxy and wrong anywhere else, so startup says so:

  • an enabled endpoint with no Authentication entry warns that anything reaching the address is served the mailbox, and names the section that fixes it;
  • an enabled endpoint terminating no TLS warns that any credential a client presents is readable on the path, and names its clear-text port;
  • an endpoint that accepts a password on that port warns again, separately, because a password is the one credential here a person typed and may have typed elsewhere — it names this surface, the port, and, where ReverseProxy:TrustedProxies names one, that the hop is the one between the proxy and this process;
  • an endpoint serving the page over clear text an operator explicitly permitted reports that separately, at every startup, naming the permission rather than assuming it is still true.

One thing the page itself does less of over clear text, and no setting turns it back on: a browser withholds the Notifications API outside a secure context, so a client reached over plain http at anything but localhost raises no system notification while its window is behind another, draws no switch for one on its settings screen, and asks nobody for permission. It is the browser's own rule rather than this deployment's, it is decided by the address a person opened rather than by any configuration here, and the client reports the operation as one this run does not carry — which is the same thing it says on a desktop shell that linked no notification plugin. A deployment that wants the client to notify therefore serves the page over https, which is what the redirect above already is for.

All three are warnings rather than refusals, because a loopback bind, a private network, and a proxy that terminates TLS are each a deployment where one of them is the right answer, and only an operator knows which they have. Serving the page is the one part that is refused rather than warned about, for the reason the next section gives — and that refusal is about publishing a page rather than about a credential, which is why a deployment can accept a password on this port while still having to declare that the page may be served over it.

A profile this endpoint terminates TLS with is loaded before the server starts, on the same terms as the other two surfaces': material that is missing, expired, or issued for another domain fails startup with nothing listening, rather than binding a listener that then refuses every connection. The startup record names each profile it loaded and the section it was configured under, so ClientEndpoint:Https is what an operator reads this endpoint's profiles back from; rotating a server certificate is what renewing one takes.

HTTP/3, and what turns it on

A profile serves HTTP/1.1 and HTTP/2, and nothing else unless it says so. ClientEndpoint:Https:Endpoints:<n>:HttpProtocols is where it says so, and HTTP/3 is opt-in on this surface exactly as it is on the other two — HttpProtocols carries the key and its whole rule, and this section is what it means for the surface a browser calls:

{
  "ClientEndpoint": {
    "Transport": "HttpsOnly",
    "Https": {
      "Endpoints": [
        {
          "Name": "client",
          "Domain": "mail.example.test",
          "HttpProtocols": ["Http1", "Http2", "Http3"],
          "ServerCertificate": { "Bundle": { "Path": "/run/secrets/client-tls.pfx" } }
        }
      ]
    }
  }
}

Three things about that set are not a matter of taste. The host has to provide QUIC, and one that cannot fails startup rather than serving HTTP/2 under a configuration that named HTTP/3. Http1 or Http2 has to stand beside Http3, because a client reaches HTTP/3 by upgrading from a connection that advertised it and an HTTP/3-only profile is therefore a listener nothing discovers — startup refuses that too. And the TLS floor the profile states governs the other versions alone: QUIC always uses TLS 1.3, whatever MinimumTlsVersion says.

The client does nothing about it, and that is the whole of its half

Choosing a version is the browser's, not the application's. The client puts every request on the wire through one fetch call, and fetch exposes no HTTP version — no request option sets one, no response field reports one, and there is nothing a caller could pass. So the client contains no code about HTTP/3, and it is not missing any: the upgrade from the first TCP connection, the fallback to HTTP/2 when QUIC does not get through, and the per-origin memory of which answered are all the user agent's, and they work for this deployment the moment a profile serves the version.

What that costs is one round trip on a cold origin. The first request a browser makes to a deployment it has never seen goes over TCP whatever the endpoint offers, because the alt-svc header advertising the QUIC socket travels on the answer to it. A deployment that wants the very first connection to be QUIC publishes a DNS HTTPS record for the name, with alpn="h3"; that is a record in the operator's own zone rather than a setting here, and nothing about it changes what this endpoint serves.

The desktop head inherits its platform's answer. It draws the same bundle in a system WebView, so which versions it speaks are that WebView's: WebView2 on Windows is Chromium and does HTTP/3, and WebKitGTK on Linux does not. Neither is a posture this deployment configures, and neither changes what a client can reach — a head without HTTP/3 keeps using HTTP/2 against the same profile, which is the fallback the older version beside it exists to hold open.

Which deployment shape serves it

MailFathom serves HTTP/3 where MailFathom terminates TLS, which is a host process configured with the profile above on a machine providing QUIC. That is the shape this section is written for.

Every published container shape delegates it, and this is an arrangement rather than a gap. The image speaks plain HTTP and terminates no TLS of its own — Kubernetes, Compose, and Quadlet each put a TLS-terminating ingress or reverse proxy in front of it, which is also the only place a certificate has to exist. HTTP/3 requires HTTPS, so in those shapes it is the ingress that offers it to a browser, configured there beside the certificate an operator already manages. Consistent with that, the image carries no QUIC library and no deployment asset here publishes a UDP port: a container asked to serve HTTP/3 itself would fail startup on the missing QUIC transport rather than bind a socket nothing could reach. Enabling HTTP/3 at the ingress needs nothing from this section, and the client behaves the same way behind it — the ingress advertises, the browser upgrades, and MailFathom answers HTTP/1.1 on the hop it was always answering.

Serving the client from the deployment

Every published image carries the page, built into it from the client workspace under frontend/ and copied beneath the image's web root. Serving it pulls nothing, starts no second process, and costs an image that never serves it about 230 kB.

Serving the bundle is half of what an operator does, and provisioning a credential is the other half. The page opens on its sign-in screen, presents what a person gives it to the exchange, and reads this deployment's mail with the session it gets back — so a deployment that serves the page and provisioned nobody publishes a sign-in screen with nothing to present at it. A deployment offering the password form mints one with mfctl credential create --method password --username <name>, over the administrative endpoint; one that believes an authorization server's tokens maps each person's subject onto their record over the same endpoint instead. What a sign-in screen is offered is which of the two a person meets.

One setting serves a bundle from this endpoint's own listeners, where a host was given one:

{
  "ClientEndpoint": {
    "Enabled": true,
    "Application": { "Enabled": true }
  }
}

It is off in every default — in the configuration, in the chart's values.yaml, in the Compose file, and in the Quadlet unit — so adopting a release publishes no page. Each deployment asset turns it on with one decision of its own: client.enabled in the chart and MAILFATHOM_CLIENT in Compose each write both keys below, while the Quadlet unit carries them as two adjacent commented Environment= lines, because a .container file has no variable to write two keys through. Kubernetes, Compose, and Quadlet each state theirs.

What it adds is static files and nothing else. The bundle answers beneath /app/ on the listeners this endpoint is served on — /app redirects there, and the root of the listener serves no page — and the routes beneath /api/client are unchanged: same credentials, same grants, same limits. The page itself carries no credential and needs none — a browser has to load the application before it can obtain one — and what that application then calls is authorized exactly as any other caller is. Turning this on grants nobody anything; it puts the client in front of the sign-in the endpoint already required.

Serving it from the same origin as the surface it calls is the point of serving it here at all: the page then needs no cross-origin permission and Cors:AllowedOrigins has nothing to say about it. A client downloaded and installed rather than served reaches the same routes from an origin of its own and does need one — the origin a downloaded head sends is which.

Clear text is refused rather than warned about, and that is the one difference from every other posture on this page. A page is what a person types their credential into, so a deployment that serves it over a socket this process opened in the clear fails at startup naming the two ways out: terminate TLS here, with ClientEndpoint:Transport set to HttpsOnly and a ClientEndpoint:Https:Endpoints profile; or state that something in front of this process already did, by writing ClientEndpoint:Application:AllowClearText: true. Nothing here can tell an ingress terminating TLS from a socket published to a network, which is why the second one is a declaration an operator makes rather than something MailFathom infers. A socket that only redirects to HTTPS serves nothing and needs no permission.

Two more refusals belong to the same setting. Writing Application:Enabled while ClientEndpoint:Enabled is off fails at startup rather than being ignored, and so does enabling it on a host that carries no bundle — which is every host today, and was already the answer for a service run straight from the sources. It says so instead of answering a page of 404s.

There is no client-certificate profile here. The trust question a certificate answers is a second one this endpoint does not yet ask; where it is served is stated in exactly the settings the existing endpoints use, so the day it does ask, the answer arrives as a profile on a listener already shaped to carry one.

The content security policy it is served with

Every file served beneath /app/ carries a Content-Security-Policy header, on the client listeners and on no other. The policy is the bundle's own: the client's build writes it into the bundle as content-security-policy.txt, and the service reads that file once at startup and attaches it. A bundle carrying no such file is refused at startup exactly as a missing bundle is, because serving the page without its policy is the undefended page the file exists to prevent. A policy file that is present but empty is refused the same way, since an empty header value would remove the header from every response. Nothing here is configurable, and a proxy in front of this process should pass the header through rather than replace it.

It is defence in depth rather than what keeps the reading pane safe — that rests on no string from a message ever becoming markup. What it limits is a defect somewhere else in the client: which scripts can run in the page, and so what could read a credential kept by Keep me signed in, and which origins the page can call. It does not stop a script that does run from sending out what it read: the wide img-src and font-src below let it name any host as a picture's or a font's address.

Directive What it admits Why
default-src 'self' Anything not named below comes from the deployment that served the page or not at all
script-src 'self' and two 'sha256-…' hashes The bundle, and the two scripts the client writes into the frames that draw a sender's own markup — one reports a clicked link, one measures the embedded view's height. A framed srcdoc document inherits this policy, so each is admitted by the hash of its exact text, computed when the bundle is built; nothing a message carries runs
style-src 'self' 'unsafe-inline' A sender's own inline styles are what the full-HTML dialog and the embedded view exist to show, and a framed document inherits this directive too
img-src 'self' data: https: http: A message's pictures come from whatever server its sender named, and asking to load them re-reads that message with those addresses left in, so no host can be named. data: is a picture the message or an attachment carried inline
font-src 'self' data: https: http: The client's own typeface ships inside the bundle; the other sources are a sender's web font, which asking to load a message's remote content restores beside its pictures
connect-src 'self' The page calls the deployment that served it — the routes beneath /api/client, the signal channel, and the telemetry routes — and nothing else. A page a deployment served offers no control for naming another. This restricts fetch, XMLHttpRequest, and WebSocket connections only; a picture or font address is governed by the two rows above, which still admit any host
frame-src 'self' blob: An attached PDF is drawn by the browser's own viewer from an object URL the page made
object-src 'none' No plugin content
base-uri 'none' No <base> element can redirect the page's relative references, in the page or in a frame
form-action 'none' No form submits anywhere; the client's own forms are handled by the page
frame-ancestors 'none' No other page may frame this one

connect-src is the one directive a deployment's own configuration widens, and it is widened at startup rather than configured: each published authorization server's issuer contributes its origin — scheme, host, and port, never a path — to the directive the bundle wrote, so the page may read that server's discovery document and redeem a code there. Two realms on one server contribute one origin. A deployment publishing no such server serves the policy its build wrote, byte for byte, which is why turning a provider on is the only thing that widens it, and a bundle whose policy names no connect-src at all gains the directive rather than having nothing to widen. Nothing else in the policy moves, and the reason it has to move at all is that connect-src 'self' would otherwise refuse the flow at the first request — a page cannot sign somebody in to a server it may not call.

The desktop head carries the same policy with one directive wider. Its connect-src is 'self' ipc: http://ipc.localhost https: wss: http: ws:: ipc: and http://ipc.localhost are how its page reaches the shell's own commands, and the four schemes admit whichever deployment its user names, because that is decided at run time while its policy is fixed when the application is built. frontend/src/Client.App/contentSecurityPolicy.ts holds the directives both heads share with the reason for each beside it, and frontend/src-tauri/run-tauri.ts holds the desktop head's connect-src and its reason.

What it says about caching the page

Every file served beneath /app/ carries a Cache-Control header, on the client listeners and on no other, and it is one of two values. Nothing here is configurable.

What is served Cache-Control What a browser does with it
The entry document, at /app/ and at /app/index.html, and every other file whose name is the same in every build no-cache Keeps its copy and asks before every use of it. An unchanged file is answered 304 Not Modified with no body, from the ETag and Last-Modified the response carries
Every file beneath /app/assets/ public, max-age=31536000, immutable Keeps its copy for a year and does not ask

The entry document is the file this exists for. It is the only one that names the rest of the bundle, and it names each script and stylesheet by a hash of its content. A browser reusing a stored copy of it without asking therefore goes on running the client of the release before against the service of the release now, and what a person meets is the disagreement between the two — a permission the client reports withheld that the role grants, a screen calling a route that has changed shape — with nothing on the page saying that the page is the stale half. A response stating no freshness is one a browser may reuse on a heuristic drawn from the file's age, and the files in an image are as old as the image, so no-cache is stated rather than left to that: the next time the page is opened after an upgrade it is the build the deployment now serves, and an upgrade carries no step asking anybody to clear a browser's cache.

A file beneath /app/assets/ is kept without asking, because that directory is where the client's build writes the files it names by a hash of their content, and it writes nothing else there. A changed file is a new name, so a stored one never answers for different content, and a visit to a deployment that has not been upgraded costs one conditional request for the entry document rather than the client again. The service reads the directory and not the shape of a name: which files are hashed is the build's decision, and a name can only resemble one. The directory is the one the bundler writes hashed files to unless told otherwise, and frontend/src/Client.App/vite.config.ts tells it nothing else; a file copied in from that package's public/ directory keeps its name and lands beside the entry document.

These headers decide what the next load of the page fetches, and they do not reach a page already running. A tab that was open across an upgrade keeps the build it loaded until it is reloaded.

A proxy in front of this process passes the header through, as it does the policy above, and adds no freshness of its own. A cache lifetime or an expires rule applied to /app/ or to every .html file, and a shared cache that answers for the entry document without revalidating it, each put back exactly the stale page this header prevents — and the proxy is then the only place that says so. The validators belong with it: ETag and Last-Modified on the way out and If-None-Match and If-Modified-Since on the way in are what make the question a 304 rather than the document again.

Publishing it

Behind an ingress, publish /api/client as its own path to the same backend the other surfaces are on and keep the prefix — the client appends the rest to the address it was configured with, and the Resource written above has to be the public URL a browser actually reaches. The chart's ingress.hosts[].paths is where that goes; deploying on Kubernetes is the page.

An ingress answers no preflight on the application's behalf, so Cors:AllowedOrigins still has to name the origin the page is served from even where the ingress and the page share a host.

Serving the page needs one more path published: /, to the same backend, so the bundle and the routes it calls arrive on one origin. Publish that only where the page is actually enabled — a path routed to a deployment that serves no client is a 404 with an ingress in front of it.