The health endpoints and the listener they are served on
An orchestrator decides three things about a process by asking it: whether it has finished coming up, whether it can serve a request right now, and whether it is still running rather than stuck. MailFathom answers those three questions on three paths, served on a listener of their own. This page records what each one consults, which port it answers on, how to turn the surface off, how to put TLS in front of it, and why it carries no credential and no rate limit.
The probes are on their own port
{
"HealthEndpoints": {
"Enabled": true,
"BindAddress": "0.0.0.0",
"Port": 8081,
"Transport": "Http"
}
}
| Setting | Default | Meaning |
|---|---|---|
Enabled |
true |
Whether the probes are served at all. false maps no route and opens no listener |
BindAddress |
0.0.0.0 |
The IP address the probe listener binds. 127.0.0.1 restricts the probes to the machine, :: binds IPv6 |
Port |
8081 |
The port the probes answer on. Under HttpsOnly this is the TLS port |
Transport |
Http |
Http, HttpAndHttps, or HttpsOnly — see Transports |
HttpsPort |
none | The TLS port, required by HttpAndHttps and unused by the other two |
Domain |
none | The DNS domain the configured certificate covers, required by the two TLS transports |
ServerCertificate |
none | Where the certificate and its private key come from, on the same terms the MCP endpoint states them |
The section is bound strictly. A misspelled key fails startup instead of leaving the probes on a port an operator believed they had moved, because a listener published to the wrong network is not a setting that failed to apply.
Every setting here is restart-required. The section decides which sockets are opened and which routes exist, and both are settled while the host is composing itself, so an edited value takes effect on the next start. The material behind a configured certificate reference is the exception the secret machinery already covers: rotating what a reference points at needs no configuration change, though this listener reads its certificate once, while starting.
The probe listener is never the MCP endpoint's. A probe path asked on the port that serves /mcp is
answered with 404, and /mcp asked on the probe port is answered with 404 as well. The decision is taken from the
port the connection arrived at — a property of the socket the operating system accepted it on, not a header the caller
wrote — so publishing the probe port to an orchestrator's network does not publish the mailbox to it, and publishing the
application port to clients does not hand them an unauthenticated dependency report. The one exception in either
direction is the HTTP API document and the explorer, which belong to no surface and answer
on every bound port — and which a deployment never has, because they exist only in a Development process.
A probe port that collides with another surface fails startup with a message naming both, rather than failing to bind with an address-in-use error that names a socket.
Nothing changes with the environment
The endpoints behave identically in every environment. ASPNETCORE_ENVIRONMENT decides nothing here, so what a
developer tests is what runs in production, and the only difference between two deployments is what each one
configured. The service-defaults scaffold MailFathom started from served the probes in Development only, which left
every container and Kubernetes deployment with nothing to ask and every development run serving them on the listener
its MCP clients reach.
The probe listener is one of four, and only one
Every surface this process serves binds its own listeners from its own section: the probes from HealthEndpoints, the
protocol surface from McpEndpoint, the administrative surface from AdminEndpoint, and the client surface from
ClientEndpoint. Nothing else opens a socket
here, and the host's own ways of naming one — ASPNETCORE_URLS, ASPNETCORE_HTTP_PORTS, ASPNETCORE_HTTPS_PORTS, and
Kestrel:Endpoints — are refused at startup rather than ignored, because Kestrel drops the first three as soon as a
listener is bound in code and binds the last beside them on a socket no section describes.
A probe port may be one another surface already binds. The socket is then bound once and serves both, and a probe path
asked on a port the probes are not on is still refused with a 404 — sharing widens what a listener answers and nothing
else. What it costs is exposure, which is the decision this section exists to give you: on a shared port the probes
answer wherever that port is published. Turning HealthEndpoints:Enabled off changes nothing about where anything else
is served, and turning every surface off is refused, because a process binding no listener at all would fall back to
Kestrel's own default address.
Where each surface is served records the whole arrangement.
The three probes
| Probe | Path | Consults | A failure means |
|---|---|---|---|
| Startup | /started |
The host's own startup gates: every secret reference the deployment's own sections carry resolved, the database schema verified, every user the deployment serves reconciled against the rows it holds and their own mailboxes' secrets resolved with them, and — only where its own switch is on — the spam scanner naming the corpus it scores under | The process has not finished coming up; the grace period continues |
| Readiness | /health |
The dependencies a request needs: the database, each declared AI provider, and — only where something actually runs against it — the personal-data analyzer and the object-storage bucket, or, where no endpoint is configured, whether stored content points into one anyway | The instance stops receiving traffic; it is not restarted |
| Liveness | /alive |
Process-local state only | The container is restarted |
One endpoint cannot answer all three, because the three have different consequences. Wiring liveness to the readiness answer is the mistake that turns a database outage into a restart loop across every replica of a process that is working correctly; the Helm chart's values schema refuses that configuration rather than discouraging it.
Membership is decided by a health-check tag. A check states which probes it belongs to once, where it is
registered — live, ready, startup — and a check that states none reaches no probe. That is deliberate: the
framework's default is to include every registered check in every endpoint, which is how a dependency check ends up
able to restart the process. Because a probe over no checks reports healthy, composition refuses to start when any of
the three would answer without consulting anything.
A declared AI provider degrades the readiness probe rather than failing it. An embedding provider and a chat
provider each register a check of their own — ai-embedding-provider and ai-chat-provider — when the deployment
declared one, and neither ever reports worse than degraded. Neither serves a request path: an instance whose embedding
provider is failing still answers every search lexically, and one whose chat provider is failing still answers every
search at all. So /health reads Degraded while a provider is unreachable, the instance keeps its traffic, and the
liveness probe is untouched — restarting the process could not fix a provider and would turn one outage into two.
Neither check calls a provider to find out; each reports the outcome of the last real call, which is what keeps a
health scrape from spending an operator's money. Chat generation
records the states and what each asks of an operator.
The personal-data analyzer is the opposite case. Where the personal-data scanner runs over any mailbox the
deployment serves — the deployment's own switch, or an account that asked for
it — the
scanner fails closed, so an instance whose analyzer cannot answer refuses every read, derived write, and egress that
scanner guards — it is not serving a narrower service, it is serving nothing the scanner covers. So the
personal-data-analyzer check reports unhealthy, /health answers 503, and the instance leaves the load balancer.
It never reaches the liveness probe: restarting this process cannot start the container beside it, and doing so would
turn one sidecar's outage into a restart loop.
The check is skipped entirely where no account's posture runs that scanner, which is what keeps a deployment carrying a leftover analyzer address from reporting itself unready over a scanner nobody is running.
Like the database check and unlike the two above it, this one reaches its dependency on each scrape. The analyzer is a
container with a lifetime of its own — it may become ready after MailFathom and may stop answering long afterwards — so a
verdict taken once would be wrong in both directions. That is also why an unreachable analyzer is not a startup failure: the host comes
up, reports unready, and becomes ready by itself when the analyzer does. The question asked is which entities the
analyzer recognises, asked once per configured language and answered from its own registry: a language that answers
nothing at all fails the check by name, and a switched-on category is judged across the languages together, so adding one
never turns a ready instance unready. The whole scrape runs under one SensitiveContent:ScanTimeout rather than each of
its requests under a timeout of its own, so naming more languages costs more requests and never a longer scrape — an
analyzer too slow to finish inside that budget reports the instance unready, which is what it would be anyway once a scan
missed the same budget. Each transition — into unavailability and back out of it — is written to the log,
at Error and Information respectively, because a probe response carries no reason and the log is where an operator
reads one.
Sensitive-content scanning
records what the scanner does with an analyzer that is not there.
The object-storage bucket is the same case, for the same reason. Where ContentStorage:Backend selects
ObjectStorage, an object-storage check joins the readiness probe alone and reports unhealthy when the bucket
does not answer. Unhealthy rather than degraded because a content backend is not a service a deployment can serve a
narrower version of: the bucket a deployment selected is where it means its message payloads to live, so an endpoint
that refuses a write is the store failing rather than one feature being unavailable. Reaching the liveness probe would
turn one endpoint's outage into a restart loop across every replica, since restarting this process cannot make a bucket
reachable.
It reaches the bucket on each scrape, and asks all three questions a payload needs answered: it lists beneath the
deployment's prefix, writes a zero-length object under a key of its own, and removes what it wrote. All three because
each fails on its own — an endpoint that answers a listing and refuses a write is a deployment that will accept mail and
be unable to store it — and they stop at the first failure, because reporting three would tell an operator that three
things are wrong. The probe stores no mail to find out: nothing about a message, an account, or a folder takes part
in it. A bucket that has been taken away is a readiness condition rather than a configuration error a binder could
catch, which is what
ADR 0017
§ 1 decided; the host comes up, reports unready, and becomes ready by itself once the bucket answers. Each transition is
written to the log at Error and Information as the analyzer's are, with the classified failure behind it, because
the response carries no reason and the message names the configuration key rather than the address.
The opposite case has a check of its own, and it is on where that one is off. A deployment that selected the object
backend, stored messages through it, and then lost the configuration keeps every one of those rows intact and
unreadable — and nothing else notices, because the mailbox, the timeline, and the metadata all answer from the database.
So where ContentStorage names no endpoint at all, an object-backed-content check joins the readiness probe instead,
asks the four content tables and the stored files on each scrape whether any row names the object backend, and reports unhealthy when one
does. The two are never both registered: where an endpoint is named, the check above already asks the sharper question,
about the endpoint rather than about the configuration.
It is a readiness condition rather than a startup gate for the reason the bucket is one, and for a second: the question
is asked of the database, so a host that answered it while composing would refuse to start against a database no
migration had reached yet. A read that fails is reported as this check failing rather than answered as an absence,
because a database nothing can be read from is not a deployment holding no object-backed content. The remedy is a
configuration key rather than anything that can be done to the process, which is what the Error record says: restore
the ContentStorage:ObjectStorage block the content was stored through, and the instance becomes ready by itself. It
reads no mail to find out — the query asks which backend a row names and nothing about the message, the account, or
the folder.
The user gate refuses to start rather than reporting unready. A caller that names no user acts for the sole user the deployment holds, so the gate settles whether there is one before anything serves a request: it reads whether the deployment holds nobody, one user, or several — no further than two rows, and never anybody's record. A user is read from their own record the first time something acts for them, so what a start costs does not grow with the people a deployment holds. No configuration source names a user or declares a mailbox, so there is nothing here to reconcile a file against. It runs behind the schema gate, because that table is the schema's, and a deployment it cannot settle does not come up:
| What the gate found | What it means | What to do |
|---|---|---|
Several users while McpEndpoint or ClientEndpoint requires no authentication |
Such a surface admits a caller that brought nothing, so it could not say whose mail an act is about and every caller reaching it is composed against the single user the deployment holds. One user or none is admissible: with none there is nobody such a caller could be handed | Require a credential on those two surfaces — every one of them is a record naming its user, whichever method presents it — or switch them off. AdminEndpoint is not among them: an administrator acts for the deployment, and every user-scoped route there names the user it is for |
It is a refusal rather than degraded readiness, and deliberately: the alternative is a process that serves mail while it cannot say whose mail it is serving. It is also a fact about the users the deployment holds rather than about one row among them, which is what separates it from the next paragraph.
One record this deployment will not read never stops the start. A user's document that is not the settings a document holds, a mail account declaration that will not bind, and a mailbox whose secret reference or trust anchor cannot be resolved are each held back on their own when a replica first reads that user: the user is left unserved or the mailbox is left out, and every other user and mailbox is served exactly as before. Records this deployment will not read is where an operator meets them, and a record this deployment will not read states what each one costs. The reason is the one this whole table exists for, turned around: a deployment that cannot say whose mail it serves must not start, and a deployment that can say it for everybody but one person must not refuse to serve the rest.
A deployment holding no user is not refused. A fresh database holds none, so that is where every new deployment
stands until its first user is recorded, and where one whose every user was erased returns to: the gate finds nobody,
the deployment reports itself started, and it serves nobody until somebody is recorded — at which point
that person is served without a restart, their mailboxes included. Synchronization being switched on with nothing
recorded to synchronize — where a first run stands, holding nobody yet or a user declaring no mailbox yet — is reported
at Information rather than refused. Every user the deployment holds
is served, each from their own record; there is no held user nobody serves, because there is no file left to stop
naming them. The one exception is the user whose own record this build will not read, who is reported as
held back rather than served — and is served again, without
a restart, the moment the record is repaired.
A deployment whose file still carries MailSynchronization:Accounts does not start, and that refusal comes from
the settings a start composes rather than from this gate. Nothing imports what the section declared, so the message
names the section and the commands that replace it —
configuration sources carries it in full.
The startup gates are reported rather than re-run. The probe reads a flag the gates set as they complete, so polling it opens no connection and costs nothing, and once it turns healthy it stays healthy.
Only the secret-reference gate runs before the listener opens, because it is the one registered as a hosted lifecycle
service and the host runs that stage ahead of every hosted service's start. The schema gate, the user gate, and the
spam-scanner gate are ordinary hosted services, and the web host registers its own while the builder runs, so it starts
first and the port is already accepting connections while those three run. That window is exactly what the probe is
for: hold traffic off an instance until /started succeeds rather than inferring readiness from the port answering.
A gate that refuses still aborts startup, so the process exits rather than serving with a gate unmet.
What a response carries
The body is one word: Healthy, Degraded, or Unhealthy, with 200 for the first two and 503 for the last.
Check names, exception messages, stack traces, durations, connection strings, host names, and dependency descriptions are all absent, and this is a security property rather than a minimalism preference. The endpoint answers without a credential, so everything in the body is disclosed to whoever can reach the port; a check name says which dependencies exist and a description says what is wrong with one. An orchestrator compares the one word.
Probe requests are excluded from tracing, and the host's own log configuration keeps Microsoft.AspNetCore at
Warning, so polling every few seconds for the lifetime of the process produces neither a span nor a log record per
request.
No credential, no origin gate, no rate limit
The probe endpoints carry no authentication, no authorization, no API-key check, no CORS or Origin gate, and no rate
limiting. That is the stated posture, not an omission:
- An orchestrator holds no credential and has nowhere to get one. A probe that could be refused for its credential is a probe that reports a process as failed while it is working.
- A throttled probe fails, and a failed liveness probe restarts the container. A limiter on this listener would convert a burst of polling into an outage, so no endpoint's rate limits ever extend to it — the MCP endpoint's, the administrative endpoint's, and the client endpoint's are each attached to that surface's own routes rather than applied as the process's default policy, so a probe route carries none of them.
One bound does reach this listener, and it is the exception that proves how the rule above is drawn.
ConnectionLimits is a ceiling on connections rather than on requests,
and a connection is accepted before routing has decided which listener it was for — so unlike every limit named above,
it cannot recognize a probe and cannot be made to exempt one. The framework exposes no per-listener form of it.
What that means operationally: a flood that saturates the process-wide ceiling against /mcp leaves this listener
unable to accept, liveness stops answering, and the orchestrator restarts the container. Narrowing ConnectionLimits
brings that point closer; the ceiling is not what creates the failure, since a flood left unbounded exhausts the
process's file descriptors and produces the same outcome less predictably, but it is what decides the number at which it
happens. Size it against the connections a real client population holds open rather than against the request limits,
and publish the probe port on a network the flood cannot reach — which is the same control every other line in this
section rests on.
Exposure is controlled by which network the port is published on, and by the transport it is served under. Nothing else on this listener depends on a credential, and the TLS listener asks for no client certificate even where the MCP endpoint's own listeners ask every client for one.
Transports
Transport |
Clear-text listener | TLS listener |
|---|---|---|
Http |
Port |
none |
HttpAndHttps |
Port |
HttpsPort, which must be stated |
HttpsOnly |
none | Port |
Http is the default and the whole first-release posture for most deployments: adopting the release costs no
certificate work, and a probe network that is already trusted needs none. TLS is a deliberate upgrade.
One socket serves one scheme, which is why HttpAndHttps needs a second port rather than a flag. The port is stated by
the operator rather than defaulted, because a default would pick a port nobody published and could collide with
something already listening. It exists for the interval in which a deployment moves from clear text to TLS and both
have to answer.
{
"HealthEndpoints": {
"Port": 8081,
"HttpsPort": 8443,
"Transport": "HttpAndHttps",
"Domain": "probe.example.test",
"ServerCertificate": {
"CertificateChain": {
"Name": "probe-chain",
"SecretReference": "file:/etc/mailfathom/tls/probe-fullchain.pem"
},
"PrivateKey": {
"Name": "probe-key",
"SecretReference": "file:/etc/mailfathom/tls/probe-privkey.pem"
}
}
}
}
{
"HealthEndpoints": {
"Port": 8443,
"Transport": "HttpsOnly",
"Domain": "probe.example.test",
"ServerCertificate": {
"Bundle": {
"Name": "probe-bundle",
"SecretReference": "file:/etc/mailfathom/tls/probe.pfx",
"Password": {
"Name": "probe-bundle-password",
"SecretReference": "systemd-credential:mailfathom-probe-bundle-password"
}
}
}
}
}
Certificate material
The material is resolved by the loader the MCP endpoint's HTTPS profiles use, through the same named-secret references secret provisioning describes. Either a PKCS#12 bundle or a PEM chain beside its private key; configuring both is refused, because which of them states the identity would otherwise be decided by nothing an operator wrote.
Domain is what the material is proven against. An orchestrator dialling the pod's own address verifies nothing — the
kubelet's HTTPS probe skips certificate validation entirely — which does not make the claim optional: the operator
still says which certificate this is, and a certificate provisioned for another name is a mistake worth failing on.
It has to be a DNS name, and startup refuses anything else. An IP address does not work here, which is worth
stating because the probe listener is the one thing an orchestrator dials by address: matching is against the
certificate's DNS subject alternative names, and those never carry an address, so a certificate with an IP SAN would be
refused too. Wildcards belong in the certificate rather than in this setting — a certificate whose SAN is
*.example.test covers a Domain of probe.example.test, one label deep, exactly as a client would accept it.
A TLS transport never downgrades. Material that is missing, unresolvable, expired, or unusable fails startup with nothing listening. There is no development-certificate fallback and no self-signed fallback, because a probe answering on a port an operator believed was TLS is worse than one that does not answer.
The certificate is loaded before the server starts, so an expired one is a startup failure rather than a handshake every probe meets afterwards. Startup also warns when the certificate expires within thirty days.
Turning the probes off
{
"HealthEndpoints": {
"Enabled": false
}
}
No probe route is mapped and no probe listener is opened. Nothing else about the host changes, and no second setting decides the same thing. A deployment behind something that already tracks process health, or one where the probe port cannot be published to anything that would use it, is the case this exists for.
Kubernetes
The chart wires all three probes to a container port of its own and never to the Service:
probes:
port: 8081
startup:
path: /started
periodSeconds: 5
failureThreshold: 30
readiness:
path: /health
periodSeconds: 10
liveness:
path: /alive
periodSeconds: 20
probes.port sets the container port the kubelet dials and the HealthEndpoints__Port the host binds, so the two
cannot drift. The kubelet reaches a container port on the pod's own address without the Service publishing it, which is
what keeps the probe listener off the network the MCP endpoint is served on. Setting it to 8080 is refused by the
values schema, and that refusal is the chart's alone — the host would share the socket, as the probe listener is one of
four, and only one describes, which is exactly what publishing the
probes on the port the Service carries would then mean.
The rendered probes are the ones the schema pins: /started for startup, /health for readiness, /alive for
liveness. Each path is a const in the schema, so a probe pointed at the wrong endpoint is refused at install time
rather than producing a deployment whose restarts nobody can explain. See
deploying to Kubernetes.
Docker Compose
The Compose deployment publishes the probe port to loopback:
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:8081:8081"
curl -fsS http://127.0.0.1:8081/started # has it finished coming up
curl -fsS http://127.0.0.1:8081/health # can it serve, database included
curl -fsS http://127.0.0.1:8081/alive # is the process still running
MAILFATHOM_HEALTH_BIND and MAILFATHOM_HEALTH_PORT move the published address, the way MAILFATHOM_HTTP_BIND and
MAILFATHOM_HTTP_PORT do for the MCP endpoint. Keep it on loopback unless the machine asking is not this one.
The Podman Quadlet deployment publishes the same two ports to the same address, through a
PublishPort= line in the unit rather than through a variable, so moving one is an edit to the unit followed by
systemctl --user daemon-reload.
The container declares no Docker HEALTHCHECK. Docker and Podman run one as a command inside the container, and the
image is chiseled: it carries no shell and no HTTP client for one to be written in. Adding either so the container could
ask an endpoint that is already reachable from outside would grow its attack surface for nothing. See
the container image.