Table of Contents

Administering your deployment

MailFathom ships a command, mfctl, that talks to a running deployment from your own machine. This page is the user's view of it: what it is for, the path from a running service to a verified sign-in, and what it deliberately cannot do yet. The full contract — every asset name, every stored path, every message the command can print — is administering a deployment, and this page links there rather than repeating it.

What the command is, and is not

mfctl is a client. Every operation it performs is an HTTP request to the deployment's administrative endpoint, so it runs on the machine you administer from rather than the one the service runs on — your laptop against a container on a server, or against a pod in a cluster.

It reports how the deployment is configured and changes one layer of it. mfctl config reads the settings the deployment composed from every source and names the layer that decided each — a provisioned file, an environment variable, a command-line argument, .NET User Secrets, or the persisted layer — and it writes to the persisted configuration layer alone, one document in the database composed at startup like every other source. That is changing a setting without a restart below. The deployment's own files and environment, described in configuration sources, are read and reported but never edited; the command never opens the database directly and never touches the secret store.

Which layer decided a setting is the thing to read before changing one. Three sources outrank the persisted layer — .NET User Secrets, unprefixed environment variables, and command-line arguments — so a value one of them supplies goes on coming from there whatever the layer is made to say, and mfctl config refuses such a write rather than committing a version that changes nothing. mfctl config get names the source beside the value, which is what that decision is made from. Everything else the command does is the deployment's own state rather than its configuration: placing a mailbox credential, asking for work to be run, disposing of a folder's stored mail, and maintaining the contact book.

What it prints is meant to be read and safe to capture. A command's result goes to standard output and everything else to standard error, so redirecting one captures the answer alone, and a redirected run — like any run whose environment sets NO_COLOR — carries no escape sequences at all. How a listing and a single record are laid out, and which lines colour marks, is stated in administering a deployment with the rest of the contract.

Before it can answer

The administrative endpoint is off unless a deployment turns it on, and a credential reaches it only where it was provisioned to. An API key handed to an MCP client authenticates nothing here, deliberately: reading a mailbox and administering the service that reads it are different authorities.

{
  "AdminEndpoint": {
    "Enabled": true,
    "BindAddress": "127.0.0.1",
    "Port": 8090,
    "Authentication": [
      { "Method": "password" },
      { "Method": "api-key" }
    ]
  }
}

Six things about that block are worth understanding before you copy it:

  • An administrator is a user holding an administrative role, and Authentication only says how they may sign in. The first start records the default administrator, admin, with the password MAILFATHOM_ADMIN_PASSWORD carries — admin in the Compose and Quadlet assets — and that is your first sign-in; change it at once with mfctl credential rotate. Anybody else signs in with a credential of their own provisioned with --surface admin, restricted with --source-network where it helps, and every act is attributed to their user and that credential. Who administers the deployment is the whole of it.

  • It binds a socket of its own. 127.0.0.1 above is the safe starting point — reachable from the machine the service runs on and nowhere else, which is what an SSH tunnel is for. Publishing it more widely is a decision, not a default. The keys are in the endpoint configuration, and how it relates to the port your MCP clients use is where each surface is served.

  • No credential is written into the configuration. Every one of them is a record beside a user in the running deployment, provisioned with mfctl credential create.

  • A clear-text endpoint is warned about at startup, not refused. It is the right posture behind a TLS-terminating proxy or on a loopback bind, and the wrong one anywhere else; only you know which you have. Configure AdminEndpoint:Https:Endpoints to have MailFathom terminate TLS itself.

  • It is rate limited without your writing a number. An endpoint that answers a network has to bound how fast a caller may present wrong credentials, so the limits apply the moment you enable it and the applied numbers are stated at startup. Rate limiting is where the settings and the one way this endpoint's limit differs from the MCP endpoint's are recorded.

  • A request that runs too long is abandoned, also without your writing a number. The ceiling defaults to ten minutes because the MCP endpoint shares the setting and an AI-backed answer can legitimately take minutes; no administrative route reaches a provider, so this is the endpoint worth narrowing. Request timeouts is where that is recorded.

Getting the command

Every release attaches a self-contained binary per platform, with nothing to install beside it — the .NET runtime is inside the file. The asset names and the checksum that tells a genuine download from a tampered one are on getting the command, and on Linux the install script does the whole of it in one line.

Download the one for the machine you administer from. The command talks to a deployment over HTTP, so it does not have to run where the service runs — that is the whole point of it being a client.

Take it from the release your deployment is running. The command and the deployment have to agree on major.minor, because a minor release is allowed to change what they say to each other; a pair that does not agree is refused rather than attempted, and a pair that differs only in patch or nightly warns and carries on. Take the command from the deployment's own release line is the rule in full.

Signing in

The first sign-in to a new deployment is the default administrator's, with its password:

$ mfctl login --endpoint http://127.0.0.1:8090 --name local --mode password
Password for 'admin':
Signed in to http://127.0.0.1:8090 as admin (3f1d...) (MailFathom 0.2.0), saved as profile 'local' and selected.

--username names anybody else who signs in with a password. With an API key instead:

$ mfctl login --endpoint https://mail.example.test:8443 --name production
Administrative credential (an API key, or an access token from the configured authorization server):
Signed in to https://mail.example.test:8443 as Alice Example (3f1d...) (MailFathom 0.2.0), saved as profile 'production' and selected.

The credential is typed at the prompt or piped in, never passed as an argument — an argument reaches your shell history and the process list. It is checked against the deployment before anything is written, so a wrong key, a wrong port, and a host that is not MailFathom all fail here rather than at some later command that leaves you guessing which of the three it was.

If the deployment is configured for OAuth, sign in with a browser instead and let it do the authenticating:

$ mfctl login --endpoint https://mail.example.test:8443 --mode interactive --client-id mfctl

--mode device is the same thing on a machine with no browser: it prints a short code to enter on your phone. Either way the only thing you supply is the client identifier — the command asks the deployment where to authorize. Your access token is then renewed for you until the sign-in genuinely ends, and how long that is depends on your identity platform; how long an OAuth sign-in lasts states the rule and the one setting that shortens it.

For a scheduled job there is a third way, and it is the one to prefer there. Generate a key pair, give the deployment the public half only — provisioned as a credential of your user with --surface admin — and sign in with the private one:

$ mfctl login --endpoint https://mail.example.test:8443 --mode keypair --private-key ~/.config/MailFathom/production.key

Nothing reusable is stored and nothing reusable reaches the deployment: the command signs a fresh credential per request, each good for about a minute, and the only thing the service holds is a public key. Signing in with a key pair has the openssl commands and the command that provisions it.

If your deployment serves a certificate your workstation does not trust — self-signed, or issued by an authority only your organization carries — the sign-in shows you that certificate and asks once whether to trust it, the way an SSH client asks about a host key:

$ mfctl login --endpoint https://mail.internal.example:8443 --name internal
…
  Fingerprint: 3B:9A:1C:…:7F
Trust this certificate for this profile? [y/N]:

Compare the fingerprint against the deployment's own before you answer; nothing has been sent yet. Saying yes stores that fingerprint on the profile, which makes the profile stricter rather than looser: from then on it accepts that one certificate and refuses every other, so a renewal or a substitution stops the profile rather than passing unnoticed. You accept a renewed certificate by signing in again. An http:// address gets a question of its own, because the credential and every later request would cross the network in clear text and a redirect to https:// arrives too late to change that. When the connection is weaker than the default has both questions in full, and the two switches a scripted sign-in states the answers with.

What is stored afterwards is one small file per user naming the deployments you signed in to — and the secrets themselves go to your operating system's own store, the Credential Manager on Windows and your keyring on Linux, so the file holds no credential at all. On a machine with no such store, a headless jump host being the usual one, the tokens are sealed into that file instead under a key beside it; mfctl login says which of the two you got rather than leaving you to guess. A key-pair profile keeps no credential in either place. Where the credential is kept states the paths, what each arrangement does protect, and what it does not.

Everyday use

What you want Command
See which deployments you are signed in to mfctl profiles
Work against a different one from now on mfctl switch staging
Work against one just this once any command with --endpoint staging
Check whether your credential still works mfctl status
Forget a deployment on this machine mfctl logout

Two of those repay a second look. status asks the deployment, which is what tells a revoked or expired key apart from a host that is simply down — the stored profile can only say what was true when you signed in. And logout forgets a local profile without revoking anything: the credential keeps working until the deployment stops accepting it, so a lost laptop is a reason to rotate the key on the server rather than to sign out.

status also prints who you are signed in as, which roles you hold and the scope each was assigned at, and what your credential may do — which is what decides whether any other command here will work:

$ mfctl status
'production' (https://mail.example.test:8443) accepts the stored credential as 'user 3f1d... credential 41d7e2b0-...' (MailFathom 0.2.0).
Signed in as Alice Example (3f1d...).
The user holds Administrator over the deployment.
It holds mailfathom.admin.read, mailfathom.admin.operate.
Documentation for that version: https://fathomise.github.io/MailFathom/docs/v0.2.0/

What you hold is what the roles assigned to your user grant, and each command needs the one permission its operation is published under — two, for the twelve commands that read something before they change it. A user whose roles grant no administrative permission at all is not an administrator, and every credential they hold is refused at sign-in. When a command is refused for want of one, it names the permission and says to give your user a role holding it, so the answer is to widen the user's roles rather than to replace the key. A role assigned over one organization or one user rather than the whole deployment is printed on a line of its own. Such a role reaches the users, the mail accounts with their mailboxes and contact books, the groups, the role assignments, and the organization its scope covers on the routes that name one — a grant held below the deployment lists them — and nothing else, and a user or a mail account outside it is answered as one the deployment does not hold. mfctl user list, mfctl organization list, mfctl account list, mfctl mailbox status, mfctl group list, and mfctl assignment list run under it show what that scope covers, mfctl role list shows every role, and any other command naming no target is refused with a sentence saying the scope rather than the permission is what is missing. What a credential may do lists the names, what each covers, and which twelve commands need a second one; what the endpoint serves names the permission every route is published under.

When you work against one deployment for a whole session, MAILFATHOM_ENDPOINT states it once for the shell. --endpoint beats it, and both beat the profile you last switched to.

Every command exits 0 when it did what you asked and 1 when it did not, having explained itself on standard error first. The troubleshooting table reads each message back to you as a cause.

Each invocation also leaves a line in ~/.config/MailFathom/mfctl.log — what ran, against which of your profiles, how long it took, and how it ended — so a command you ran yesterday is still answerable today once the scrollback is gone:

$ tail -3 ~/.config/MailFathom/mfctl.log | jq -r '"\(.at) \(.command) \(.outcome)"'

No credential and no mail goes into it, it is bounded so it cannot fill a disk, and --no-log leaves one invocation out. What it does name is your own deployment — the profile, and the address where a failure message quoted the one you typed — so read it before you paste it anywhere, the way you would the credentials file beside it. What the command records about itself has the path on each platform, every field, and the switch that turns it off for a whole session.

Authorizing a mailbox

A mailbox at a provider that no longer accepts a password — a Google Workspace account, anything on Exchange Online — needs a person to sign in once before MailFathom can read it. A headless service cannot arrange that, so the command does it:

$ mfctl mailbox authorize --provider google --client-id <client-id>

This is the one command that talks to something other than your deployment, and it is why running mfctl on your own computer matters. It listens on a loopback address, opens your browser, and catches the redirect the provider sends back — so there is nothing to copy, and the authorization code never crosses a network. On a machine with no browser, forward the port over SSH, or use --mode device for Microsoft and --mode manual for Google.

What it produces is a refresh token, and --account decides where that token goes:

$ mfctl mailbox authorize --provider google --client-id <client-id> --account 8e3f1a6b-2c4d-4f7e-a915-7b2d0c6e1f38
…
Stored the refresh token for account '8e3f1a6b-2c4d-4f7e-a915-7b2d0c6e1f38' on 'production'. It was not printed.

Named, the token goes straight to your deployment, which encrypts it and keeps it. It is never printed, so it never reaches your scrollback or a session log, and there is nothing for you to place by hand. The account has to be one your deployment configures; a name it does not know is refused and nothing is stored. Re-running it replaces what was stored, which is what re-authorizing after a revocation is.

Omitted, the token is printed on standard output and you provision it on the server yourself, as a secret reference like every other credential. That is what a deployment with no administrative endpoint needs, and it stays the right choice if you would rather place credentials yourself.

Mailbox OAuth is the whole procedure, including what each provider requires of the application you register and how a stored token relates to the reference in your configuration.

Finding out why mail is not arriving

A mailbox that looks empty and a mailbox nothing is fetching look identical from the outside. This is the command that tells them apart:

$ mfctl mailbox status

It reports, for every account your deployment configures and every folder it maps, what the deployment is doing right now, how its last run ended, how far each folder has actually got, and when that last moved.

The reading worth learning is the pair of columns in each account's folder table. Progress is how far the deployment has durably got and when it last got there; Last run is what happened the last time it tried. A folder whose progress stopped yesterday and whose last run succeeded has nothing left to fetch. A folder whose progress stopped yesterday and whose runs keep ending has stopped making headway, and the outcome beside it says why — an alias naming no folder your server advertises, a server that stopped answering, or a failure to look up in the log. Without both columns the two are indistinguishable, which is exactly the situation this command exists to end.

The account's own readings above that table say whether a run is happening now, queued behind other accounts, or waiting; and, when runs have been failing, how many in a row — which is what a wait far longer than your configured interval is explained by.

A deployment running several replicas answers about the deployment rather than about whichever one your command reached. One replica supervises each account at a time, and the answer names it beside the account, so a mailbox another replica is fetching reads as supervised by that replica rather than as one nothing has run. The phase, the backoff, and the last run are the supervising replica's own scheduling state, so they are reported where the replica that answered is the one holding the account and point you at the holder where it is not — never as "no backoff" and "no run", which would read as a mailbox nothing has ever fetched. The folder table is unaffected, its progress being durable. Answered by on the first line names the replica that composed the answer. Administering a deployment reads every line of the output back to you.

Turning semantic search on

Which model your deployment embeds with is a configuration value, and editing it starts nothing. Turning semantic search on is a separate, deliberate act, because it is the first thing MailFathom does that costs money per unit of mail — a full mailbox goes to your provider, and you should see the size of that before agreeing to it:

$ mfctl embedding activate

The command reads what the deployment would spend, prints it as passages, characters, and approximate tokens, and asks before it starts. --yes agrees up front, for a scripted run.

If your deployment also reads attachments, the same output states what reading the documents it already holds would open and how many pictures it could send to be described — a second bill, in units the first one is not counted in — and the activation is refused outright where either is past what one period admits. The refusal names the setting to raise, so you are told a number rather than left to find one.

What you want Command
Find out why semantic search is quiet mfctl embedding status
Take up the model your configuration declares mfctl embedding activate
Stop a re-embed you have changed your mind about mfctl embedding cancel-reindex

mfctl embedding status is the one to reach for first. It answers, in one output, whether a model is active, whether that model is still the one your configuration declares, whether your provider is answering, how much of the mailbox is embedded, what the current budget period has spent, and when the walk that embeds your existing mail next runs. That last line is the one to read in the minutes after an activation: until the first passages have gone out, a deployment that is simply between passes looks exactly like one that is broken.

Two of those readings say here in their labels, and on a deployment running several replicas that word matters: when the walk next runs, and what the provider last answered, are the answering replica's own and another replica may be waiting out a different pause. Everything else comes from the database and is the whole deployment's. Answered by on the first line names which replica gave you the answer.

It reports how far reading your attachments has come separately from all of that, because the two are separate: a mailbox can be entirely searchable on what people typed while every document attached to it is still unread. Beside the coverage it says what reading produced — extracted documents, described pictures, and how much the keyword index grew by — and how many attachments yielded nothing, grouped by why: encrypted, unreadable, a format your deployment does not read, too large, timed out, refused by the provider, or — the scan case — a document that parsed and carried no text at all. It is a count per reason and never a list of files, so nothing there names one of your messages. mfctl mailbox status reports the same three readings for one account.

Administering the embedding profile is the operator's reference for all three, and changing the embedding model is what a switch and a rollback cost.

Applying your rules, and seeing what they did

Mail rules select mail as it arrives, so a rule you write today does nothing about the mail already in the mailbox until you ask — or until a schedule you gave the rule asks on your behalf. That asking is a command, and so is finding out what the rules have been doing:

What you want Command
See which rules your deployment is running, in order mfctl rules list
Read one of them in full mfctl rules show file-invoices
Apply them to mail that arrived before them mfctl rules run --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Watch that run mfctl rules run-status --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Find out what a rule did, or why a message is where it is mfctl rules history --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10

mfctl rules list is the one to run after editing a rule file. A deployment refuses a reload whose rules do not validate and goes on running the previous set, which it reports to its log and nowhere else — so this is where you find out whether your edit took effect, rather than from mail that kept being filed the old way. It prints one row per rule, and the Runs on column says what runs each of them, which is how a rule naming no trigger is told apart from one that simply never matched: nothing fires such a rule by itself, and mfctl rules run is how it is run. A rule with a schedule says so in that same column, with the occasions it declares beside the trigger. It is also where a rule you meant to run over arriving mail shows that it never says Arrival.

None of these five writes a rule, and none ever will: they run the rules and read what the rules concluded. Rules are configuration, so what changes one is changing a setting without a restart or an edit to the file your deployment reads — the file is where a rule is reviewable in a diff before it reaches a mailbox, and the persisted layer is what changes one without a restart. Reading the rules, running them, and finding out what they did is the operator's reference for all five, including what the history records and what it deliberately does not.

Classifying the mail you already have

Spam classification reaches arriving mail on its own: a message is classified because it arrived, and you ask for nothing. What it does not reach is the mail that was already there — everything stored before you switched it on, and everything stored while it was off — so switching it on, switching filing on, or moving a threshold does nothing about the existing mailbox until you ask:

What you want Command
Find out what classification would do to the mail you have mfctl spam run --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Carry that out mfctl spam run --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10 --apply
Watch the run mfctl spam run-status --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Find out why a message was filed as junk mfctl spam classifications --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10 --email <id>

The run is a dry run unless you add --apply, and that is the order to do it in: run it, read what it found with run-status, and only then run it again with --apply. With filing switched on, a run over an inbox is the largest single thing MailFathom does to your mail, and the dry run tells you how much of it would move before any of it does. The verdicts are recorded either way — what --apply adds is the mail server being written to.

A second run while one is going does not start a second walk; you are told the first is still under way, on the terms it was started with. None of these three writes a setting, and none ever will: they apply the settings your deployment already holds. Whether mail is classified, what a scanner is judged by, and what happens to junk are configuration, so what changes them is changing a setting without a restart or an edit to the file your deployment reads. Classifying the mail you already have, and reading what was concluded is the operator's reference for all three.

Getting a folder's storage back

MailFathom never takes local mail away because a file changed. Switching a folder's Synchronize off stops mirroring it and keeps what it already stored; removing its mapping leaves those rows where they are as well. Both are the right default — an edit to a configuration file should not dispose of mail — and both leave you with storage you may actually want back:

$ mfctl folder erase --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10 --folder archive
1043 stored emails erased from ARCHIVE under work. The folder holds none, and its checkpoint went with them, so
mirroring it again starts from the beginning rather than resuming.

This is the only command that erases mail, and it acts on one folder of one account. It refuses a folder your deployment still mirrors, because the next synchronization run would simply fetch it all again — switch that folder off, or take its mapping out, and ask again. A folder whose mapping you already removed is accepted, which is the case this exists for.

Erasing a large folder takes a while and the command prints how far it has got. Stopping it is safe: what it reported erasing is gone, the rest is untouched, and running the same command again continues from there. Erasing a folder you have stopped mirroring is the operator's reference, including what goes with the mail and what survives it.

Filling in what a newer version records

An upgrade sometimes teaches MailFathom to record something new about a message — who was established to have sent it, which keywords its folder carries. New mail gets it because it arrives after the upgrade. The mail you already have does not, and nothing fills it in on its own: synchronization resumes from where it left off in each folder, so a message it has already stored is never looked at again.

What you want Command
Fill in what is already in the mail you stored mfctl mailbox rederive --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
See how far that has got mfctl mailbox rederive-status --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Fill in what only your mail server knows mfctl mailbox rewind --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Any of them, for a single folder add --folder archive

Reach for rederive first, because it is nearly free. Anything the message itself carries is in the raw mail already on your server's disk, so filling in the column means reading that back and parsing it. Nothing is fetched, your mail server is not contacted at all, and nothing is marked read.

The command asks for the re-reading and returns; the deployment does it. Your terminal is not what keeps it going, so closing it changes nothing and the run survives a restart of the deployment:

$ mfctl mailbox rederive --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
A re-derivation of every folder under work has been asked for.
Requested:  2026-08-18 12:00:00Z
Progress:   0 re-read, 0 unparseable, 0 no longer stored
The deployment carries the run in the background. Watch it with 'mfctl mailbox rederive-status --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10'.

Asking again while one is going is answered with the run already under way rather than starting a second, so a command you are not sure landed is safe to repeat. How far it has come is a second command:

$ mfctl mailbox rederive-status --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Scope:      every folder under work — under way
Requested:  2026-08-18 12:00:00Z
Progress:   1,043 re-read, 0 unparseable, 0 no longer stored
If it stops moving, look for the work that stopped with 'mfctl jobs dead-letters'.

rewind is the one to be careful with. Some things are your mail server's answer rather than the message's — flags, keywords, the date it received the message — and the only way to learn them is to ask for the mail again. So rewind forgets how far synchronization has got, which makes the next runs fetch the whole mailbox over again. It tells you how much that is and asks before it does anything:

$ mfctl mailbox rewind --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Scope:  every folder under work
Cost:   22,500 stored emails would be fetched from the mail server, re-read, and stored again.
Rewind that scope? [y/N]

Say no and nothing changes. Add --yes if you are scripting it and there is nobody to answer.

Neither command deletes anything, and neither creates duplicates. Your mail, its attachments, and everything built from it stay where they are; mail fetched again lands on the message that is already there. Neither one re-embeds anything either, so no refresh can run up a bill with your AI provider.

Both take a while on a large mailbox. rewind prints how far it has got as it goes, because the command is what does it; rederive returns at once and rederive-status is where its progress is read. Neither loses what it has already done: a deployment restarted mid-re-derivation picks the run up where it stopped, and mail it had already re-read is not re-read again. Bringing stored mail up to a later release is the operator's reference for all three.

Moving your stored mail into object storage

If you configure object storage for message content, MailFathom writes the next message there and leaves everything it has already stored in the database. That is deliberate — a change to a configuration file should not start rewriting where your mail is held — and it means switching does nothing for the mailbox you already have until you ask:

What you want Command
See how much is still in the database mfctl content move-status
Start carrying it into the bucket mfctl content move
Stop it while the machine is busy mfctl content move-pause
Set it going again mfctl content move-resume
Free the copies once you trust the bucket mfctl content release

The first one answers before you have configured anything, which is the point: it tells you how much of your database is message content, so you know what a bucket would take off it.

$ mfctl content move
To move:  22,500 payloads carrying 1,048,576 bytes
Move that content into the object backend? [y/N] y
Move:      under way
Progress:  0 moved carrying 0 bytes, 0 left in the database
Watch it with 'mfctl content move-status', and stop it with 'mfctl content move-pause'.

The command returns straight away — the deployment does the carrying, a little at a time, so it stays responsive while it works. Closing your terminal stops nothing, and restarting the deployment loses nothing: it picks up where it was and does not copy anything twice.

Every message is checked before and after it moves. MailFathom compares what it read against what your database recorded for it, writes the object, reads it back, compares again, and only then points the row at the bucket. Anything it cannot vouch for is left in the database, counted, and reported — nothing is lost and nothing is half-moved. mfctl content move-status says how many, and asking for another move once you have fixed the cause picks them up.

Pausing is safe and immediate. It finishes the one message it is holding and stops there; resuming continues from the same place.

Moving copies; it does not remove. When a message has been carried, MailFathom reads it from the bucket and your database goes on holding it as well — so if the bucket ever fails to answer, the message is still served from the copy you have. That safety net is the point, and it means a finished move leaves your database no smaller than it was.

Freeing those copies is a separate command you run when you are satisfied the bucket is answering:

$ mfctl content release
Retained:  22,500 payloads carrying 1,048,576 bytes
Free those copies, leaving the object backend the only place that mail is held? [y/N] y
Released:  22,500 payloads carrying 1,048,576 bytes

This one cannot be undone. What it removes is the last copy of that mail outside the bucket, so nothing does it for you — no interval, no finished move, no restart. It also refuses while any message is still waiting to be carried, and mfctl content move-status tells you when nothing is. If you would rather MailFathom hold the copies for a fixed period first, ContentStorage:Release:SafetyInterval is where you say how long, and even a release you ask for will not touch anything younger than that. Moving stored content into the bucket is the operator's reference — the order of the steps, what each one costs, and what each refusal is telling you.

Taking a mailbox out of MailFathom

The mail MailFathom stores for you is yours to leave with. mfctl export writes one account's stored mail — or one folder of it — into a zip archive holding a Maildir tree: one directory per folder, one file per message holding the bytes exactly as they arrived, and the standard flags in the file names. Other mail software already reads that shape, so what comes out is mail rather than a MailFathom backup only MailFathom opens.

It matters most when MailFathom is the only holder of that mailbox. An account you have drained has an empty server behind it by design, so this is the whole of how that mail leaves this installation — and the archive it hands you is what a backup of it is made from.

What you want Command
See what an export would carry mfctl export measure --account work
Ask for one mfctl export start --account work
Follow it mfctl export status --account work
Fetch the finished archive mfctl export download --account work --export <id> --output mailbox.zip
Stop one part way mfctl export cancel --account work --export <id>
Delete the archive mfctl export delete --account work --export <id>

--folder <alias> narrows measuring and exporting to one folder, and --yes agrees to start without being asked, which is what a scripted run needs.

It needs somewhere to put the archive. An archive is a second full copy of the mailbox for as long as it is kept, so a deployment holding its message content in the database refuses the export and names the setting to change. Moving your stored mail into object storage above is how you give it a bucket.

Measuring reads no mail — the figures are summed from what the database already records, so they come back in seconds even for a mailbox of years:

$ mfctl export measure --account work
To export:  12,480 messages carrying 3,284,140,032 bytes of stored mail

Folder   Messages  Bytes
INBOX    8,240     2,147,483,648
ARCHIVE  4,120     1,073,741,824
Sent     120       62,914,560

Nothing was written. Start the export with 'mfctl export start'.

The per-folder figures are there so you can see which folder holds the weight, which is the answer when a whole mailbox is more than your deployment's size limit allows in one piece. Starting an export shows the same figures again before it asks:

$ mfctl export start --account work
To export:  12,480 messages carrying 3,284,140,032 bytes of stored mail
Export that mailbox? [y/N] y
Export:   0199c3d0-0000-7000-8000-000000000003
State:    queued
Written:  0 messages carrying 0 bytes
Archive:  no archive to keep
Watch it with 'mfctl export status', and fetch it with 'mfctl export download' once it is finished.

The command returns straight away — the deployment writes the archive in the background, so closing your terminal stops nothing. mfctl export status --account work lists what the account has, newest first, with the counts advancing while one is being written. One account writes one archive at a time: asking again for the same thing answers with the export already running rather than starting a second, and mfctl export cancel stops one within a message and deletes whatever it had produced.

The archive does not stay forever. A finished one is kept for two days and then deleted, which MailboxExport:Retention is where you change — the period is how long this deployment is holding that mailbox twice. Downloading writes the file as it arrives rather than holding it in memory, and it refuses to write over a file that already exists, leaving that file exactly as it was: for a drained account it is very likely the only copy of an earlier export. Delete the archive once it is safely somewhere else; deleting one already gone is not an error.

Carrying a mailbox out of this deployment is the operator's reference — what is inside the archive, what an export costs while it runs, and what holding the only copy of somebody's mail obliges you to.

Background work that stopped

MailFathom does most of what it does in the background: classifying a message, embedding a passage, carrying out what a rule asked for. A piece of that work that keeps failing is eventually given up on rather than retried forever, and what is left behind is called a dead letter — a record of work nobody will attempt again. Nothing waits on one, so nothing tells you it is there:

What you want Command
See what has stopped mfctl jobs dead-letters
See what has stopped for one account mfctl jobs dead-letters --account 5b0c7d2e-8f41-4a7e-9c1d-2f6b3a9e4d10
Run one again, after fixing what broke it mfctl jobs retry --job <id>
Decide one will never run mfctl jobs drop --job <id>
$ mfctl jobs dead-letters
Stopped               Job                                   Kind                 Failed                                          Work                                                              Queued
2026-08-13 09:30:00Z  0199c3d0-0000-7000-8000-000000000002  classify-email-spam  Permanent PayloadUnreadable after 5 attempt(s)  account:work|email:0199c3d0-0000-7000-8000-000000000001 for work  2026-08-13 09:00:00Z

Run one again with 'mfctl jobs retry --job <id>', or write it off with 'mfctl jobs drop --job <id>'.

Failed is what decides which of the two commands is right. Permanent names something that will fail the same way every time — a credential, a setting, a message the deployment cannot read — so retrying before you have changed something achieves nothing. Transient names a dependency that stayed broken for longer than the queue was willing to wait, which is the case retry exists for: fix it, or wait for it to come back, and ask again.

retry runs the same piece of work rather than enqueuing a second one, so it is safe on work that reaches your mailbox. drop deletes nothing — the record stays, keeping what stopped it, and it goes on being the reason the same work is not enqueued again. Neither command waits for anything: the deployment writes the decision down and the next worker to come along carries it out, so closing the terminal changes nothing.

An empty reading is the ordinary state of a healthy deployment, and it says so rather than printing nothing. Reading the background work that stopped, and deciding what becomes of it is the operator's reference, and durable background work is what your monitoring can watch instead of you reading this by hand.

Mail you asked it to send

Sending is the one thing MailFathom does that somebody else notices going wrong before you do. A message that will not leave waits quietly: nothing retries it forever, nothing pages you, and the first sign is usually a person asking why they never heard back. The outbox commands are how you look:

What you want Command
See whether anything is stuck mfctl outbox status
See what is queued, newest first mfctl outbox list
See only what is waiting mfctl outbox list --stage Recorded
See who one message is for, and what their server said mfctl outbox show --message <id>
Take one back before it leaves mfctl outbox cancel --message <id>
Offer one again mfctl outbox requeue --message <id>
$ mfctl outbox status
Stage              Messages
Recorded           2
TransmissionBegun  1
Sent               418
Refused            3
Cancelled          0

3 message(s) are still waiting. See which with 'mfctl outbox list'.

The stage is what tells you which command is right. Recorded is a message waiting for its next attempt — leave it alone unless it stops moving, and it is the only stage cancel applies at. Sent and Cancelled are finished. Refused is a message a server will not take, so offering it again is a decision to disbelieve that and the command makes you say so: mfctl outbox requeue --message <id> --despite-refusal.

TransmissionBegun is the one that needs you. The message began to go out and the server never answered, so nobody knows whether it arrived — and MailFathom will not guess on your behalf, because attempting it again might put a second copy in somebody's mailbox rather than fix a failure. Read it with outbox show, decide, and then either requeue it or leave it where it is.

cancel means the message reached nobody: the deployment refuses to withdraw one that has begun transmitting rather than racing the worker sending it. requeue gives the attempts back and offers the message only to the addresses still outstanding, so nobody a server already accepted it for gets it twice. Neither command waits for anything — the deployment writes the decision down and the next delivery pass carries it out.

mfctl outbox list names no recipient and no subject, deliberately: a listing of who you write to and when is not something to leave in a terminal. Ask outbox show about a message when you need to know who it was for.

Reading what is in the outbox, and deciding about one message is the operator's reference, and what delivering the outbox emits is what your monitoring can watch instead of you reading this by hand.

Keeping your contact book

MailFathom holds a contact book of its own — people, the addresses each of them uses, and what you wrote about them — and mfctl contact is where you keep it:

$ mfctl contact create --name "Anna Kowalska" --address anna@example.test
$ mfctl contact add-address --id 018f2b1c-9b3a-7c41-8f7d-2c6a5e9d10ab --address a.kowalska@work.example
$ mfctl contact show --address a.kowalska@work.example

A contact is a person rather than an address, which is why the third command answers with Anna rather than with a match: one person uses a work address, a personal one, and an old one they still receive on, and the book knows those are the same person. Contacts is what the record holds and every rule it obeys.

Every one of those commands but mfctl contact delete-collected acts for one user, because a book belongs to somebody rather than to the deployment. --user is how you say which, and you can leave it off while the deployment holds one person — the command asks and acts on the single one. On a deployment holding several it refuses rather than guessing, and prints the identifiers to choose between. delete-collected is the exception because the book it empties belongs to a mail account rather than to a person: it takes --account and no --user at all.

Two of the commands are not conveniences. mfctl contact delete erases somebody — the record and their addresses go from the database and nothing can put them back, so the command shows you the record and asks first. mfctl contact export writes everything held about a person as JSON on standard output, which is what you redirect into a file and hand to somebody who asked what you have about them. Those are the two things you will need on a day when somebody asks, and they are commands so that you are not assembling either by hand on that day.

Listing is paged on purpose: your contact book is other people's personal data, so there is no command that prints all of it in one go. mfctl contact list reads a page and prints the cursor for the next one. Administering the contact book is the operator's reference for every command, option, and refusal.

The book can also fill itself, and it does not until you say so. Switching contact collection on for an account records the people that account corresponds with as its mail is synchronized. Those records belong to the mailbox rather than to any one person, and everybody assigned that mailbox reads them, so they are read beside a user's own book rather than mixed into it: where both hold one address, the record somebody wrote down is the one served. mfctl contact promote is how a user takes one on, and it writes their own copy — the mailbox's record stays where it is, for whoever else is assigned it. If you change your mind about a mailbox filling the book, mfctl contact delete-collected --account <id> erases everything that one account collected, keeps everything anybody entered, and leaves what another account collected alone — and switching collection off in configuration is the separate act that stops that account filling the book again.

The people this deployment serves

mfctl user is where every person this deployment serves is recorded and where what MailFathom reads for them is maintained — the one who reads their own mail on a deployment of their own, and each of a household or a small team alike. Nothing is written into a file: a user is recorded rather than declared, there is no configuration section that names one, and none that declares a mailbox either.

A fresh deployment holds nobody and reads no mail: mfctl user add records the first person, and a mailbox declared in their record is what it then reads. A deployment holding no user — a new one, or one whose every user was erased — starts and serves nobody, and says so at startup naming the commands that end it. A person recorded, and a mailbox declared, is served from that moment — no restart.

$ mfctl user list
3f1d... (Alex)
    MCP endpoint: on; client endpoint: on
7c02... (Sam)
    MCP endpoint: off; client endpoint: on

$ mfctl user add --display-name Morgan
Recorded Morgan as 9b41....
Their mail accounts are records this deployment holds; no configuration source reaches them. Create one with
'mfctl account add', and provision a way for them to sign in with 'mfctl credential create'. The replica this request
reached serves this user now; other replicas pick up the change after their next user write or restart.

Every command but list and add takes --user and does not need it while the deployment holds one person: it acts on the single user there is, and refuses rather than guessing where there are several. mfctl user rename replaces the label you tell somebody apart by; nothing is keyed by it, so it moves no mail and invalidates no identifier, and the new label lasts — no start reads anybody's label out of a file any more, so there is nobody a rename is undone for.

Keeping somebody off one endpoint is mfctl user endpoints. --mcp false stops any agent acting for a person who only reads their mail, and --client false keeps an automation account out of the mail client; both switches start on, and one you do not name stays as it is. It holds whichever password, key, or token they present, and whatever they are already signed in with stops working there on their next request. Nothing is deleted, so --mcp true lets them back on. The switches live in that person's record, so mfctl user edit shows and changes them as EndpointAccess too, and they cannot change them from their own client. An endpoint you left requiring no credential has no idea who is calling, so it has nobody to keep off: give it a credential first.

Mailboxes are mfctl account, and they are records of their own. mfctl account add creates one from a file and assigns it to a person, and mfctl account edit changes its settings. One address is one account in the whole deployment, and an account is served to one person at a time, so adding a mailbox somebody already has is refused, and so is assigning it to somebody else. The file is JSON, or YAML where you name it .yaml or .yml — the extension decides, the same way it decides for the configuration files you provision. What the deployment stores is JSON either way, so a comment you write to explain a setting stays in your own file.

$ mfctl account add --user 7c02... --from-file work.json
Created mail account 5b0c....

Changing more than one thing about somebody at once is mfctl user edit. It opens that person's whole record in your $VISUAL or $EDITOR and commits what you saved as one change — set it up as VISUAL="code --wait" if your editor is a graphical one, since the command reads the file back when the editor exits. Empty the buffer to abandon the session, or save it unchanged, and nothing is written either way. Passwords read back as (redacted), and a marker saved back leaves the credential beneath it alone. A password reference in one of their accounts that had already stopped resolving does not block the edit: the change commits and the command prints that problem after it, so you can correct it before the deployment next restarts — the endpoint reference holds the rule.

Add --format yaml to read and edit in YAML instead of JSON. mfctl user edit, mfctl user show, mfctl account edit, mfctl account show, and mfctl config edit all take it, and json stays the default. What you save is converted back to JSON before anything is sent, so true, 3, and an empty value mean what they meant; write "3" in quotes when you mean the text. Comments you add are not kept. A buffer that is not acceptable YAML — an anchor, a tag, a key written twice — changes nothing, and the command tells you why and where it kept your edit so you can fix it rather than start again; editing a document as YAML has the whole rule.

$ mfctl user edit --user 7c02...
Committed user record version 4.
The replica this request reached is using this account set now. A synchronization run already in flight finishes
against the previous version; the next run uses this one. Other replicas pick up the change after their next user write
or restart.

Recording a second person is refused while a surface they reach authenticates nobody. A deployment serving one person may leave the MCP endpoint open, or hold it with a key, because there is only one answer to whose mail a caller is asking about. With two people there is no such answer, so give the MCP and client endpoints a username and password belonging to a person — mfctl credential create is that — or switch them off. The refusal says which of the two applies. A deployment serving nobody is admissible on either surface for the same reason a deployment serving one is: there is no second person for an unauthenticated caller to be handed.

Letting people sign in to the client with your identity provider takes one configuration key and one credential each. The authorization server is probably already configured, because it is the same ClientEndpoint:Authentication:<n>:OAuth:AuthorizationServers:<m> block whose tokens the endpoint already believes; what turns it into a way in is writing a ClientId on it — the client you registered at that server for MailFathom — and registering the address the head comes back to, which is the page's own address for a browser and http://127.0.0.1:8766/ for the desktop head. The client then draws a control for it beside the password form, or instead of the form where no entry accepts a password.

Nothing about the people changes: each person still needs a credential mapping their subject at that server onto their record, mfctl credential create --method oauth-subject being that, and a token whose subject you mapped to nobody is refused. DisplayName beside the client identifier is what the control says where the server's short name is not the words you want — keycloak as the name, so the client draws that provider's mark, and Nordwind staff directory beside it. Offering a person a provider to sign in with has every key, and what a sign-in screen is offered what a person then meets.

A deployment upgrading from a release that declared its own mailboxes does not start until the section is cleared. MailSynchronization:Accounts is no longer read, and nothing imports what it declared, so a start that ignored it would leave you believing mail was being read that nothing was reading. The refusal names the section and the two commands that replace it: record the person with mfctl user add, create each of their mailboxes with mfctl account add, credentials included, and remove the section. Whatever else that section decided about them is stated again the same way — the spam classification posture, and the SensitiveContent block if it stated one, both of which each mail account's record carries in blocks of its own.

Taking a mailbox from its last person deletes its mail. mfctl account unassign ends one person's assignment without a restart; while somebody else is still assigned the mailbox, its mail stays theirs, and what goes with the departing person is only what they wrote there — their drafts and the recurring sends they declared, neither of which anybody else could read. Ending the last assignment erases the account and everything stored for it, exactly as mfctl account delete does, so both show what they are about to do and ask. A run already in flight drains against the document version it began with. mfctl user remove erases the person and every message, folder, attachment, and derived index the deployment holds for them; it shows what it is about to do and asks, and nothing puts it back. Before it deletes anything it stops the deployment reading the mailboxes that were only theirs, and it waits up to half a minute for a run or a job already going to finish — a mailbox still being written to after that refuses the whole erasure, naming what is running, and nothing at all is erased. Run it again once that has ended.

Nobody adds or removes a mailbox from the client. mfctl account add creates each mailbox and assigns it, mfctl account assign and mfctl account unassign decide who else reads it, and a person signed in to the client changes the folders of a mailbox assigned to them and nothing else about it. The client endpoint states what that surface writes.

Several companies on one deployment sign in under an organization. mfctl organization add --short-name TESTFIRMA --display-name "Test Firma" records one, and mfctl user set-organization --user 7c02... --organization <id> moves a person into it, taking the identifier mfctl organization list reports. From then on that person signs in with a password as TESTFIRMA/username rather than as username, so two companies can each have a jan; --none moves them back out. mfctl organization rename, set-short-name, and remove maintain the rest, and mfctl credential list shows each password credential's login in its "Resolved by" column, so you can read off what somebody should type.

A company can have an administrator of its own. A role assigned at an organization's scope administers that organization's people — recording them with mfctl user add --organization <id>, editing their records, and provisioning their credentials — and nobody else: a person outside it reads to that administrator as somebody this deployment does not hold. A grant held below the deployment lists which acts take a scope and which stay with an administrator over the whole deployment.

A company's mailboxes belong to it too, and are assigned only to its people. mfctl account set-organization --account <id> --organization <id> moves a mail account into an organization, and --none takes it out. An account in an organization is assigned only to that organization's members, and one in none only to people in none, so an assignment across the two is refused naming both, and a move of a person or an account is refused while it would leave an assignment straddling two. Nothing is unassigned for you: unassign first, move both sides, then assign again. An account you create with mfctl account add lands in the organization of the person it is created for, and mfctl account list and mfctl organization list show where each account and how many accounts each company holds. Organizations holds the rules — what a short name may contain, what a move or an assignment is refused over, and when an organization cannot be removed.

What the deployment or a company states once for its people is a settings policy. mfctl policy edit opens the deployment's in your editor and mfctl policy edit --organization <id> a company's, and mfctl policy show reads either: the defaults a person's record and a mail account start from, the values they are held to, and which of the rest the person may change. A save is checked whole and committed whole or not at all, naming every path to correct. What a policy states for people takes effect when it is saved: each person's settings are read through the deployment's policy and their company's, a forced value wins over what their record says, and a default fills in what the record leaves out. A save that would leave somebody's record without something it needs — the language a default used to supply, say — is refused naming those people. mfctl user show --effective shows one person's settings as they are served, with what supplied each. What a policy states for mail accounts works the same way for every mailbox in its scope: the server, the folders, or the scanning posture a company states once is what each of its mailboxes is read with, a mailbox's own declaration states only what the policy leaves to it, and mfctl account show --effective shows one mailbox as it is served. A policy may also hold the telemetry switch on each person's settings screen on or off: their own answer is kept and comes back when you stop holding it, and holding it on reports what somebody declined to have reported, so read what that sends before you do. Settings policies holds what a policy may state and what a save is refused over, and how a settings policy resolves a mail account what that means for a mailbox.

Sharing a mailbox is something a company does. An account in an organization can be assigned to any number of its members, and an account in none belongs to one person: mfctl account assign refuses a second person for it and tells you to move it into an organization to share it, and mfctl account set-organization --none is refused while the account is assigned to more than one person, saying how many.

What each person may do is a role you give them. mfctl role list shows the roles, mfctl assignment add gives one to a person or to a group at the whole deployment, one organization, or one person, and mfctl group add-member gives a person everything a group holds. mfctl user permissions --user <id> answers why somebody can or cannot do something: each permission they hold within what you administer, the role and group it came from, and the scope. You can give only what you hold yourself, at a scope you hold it over, and the deployment refuses to revoke, narrow, or remove from a group the last grant that lets anybody change roles. Erasing a person, or moving them to another organization, is not refused that way, so make sure somebody else can change roles before you erase or move an administrator. Roles, groups, and assignments lists the commands, and administering roles, groups, and assignments holds the rules.

A role may list a pattern, and one that does grows with each release. mailfathom.admin.* in a role's list holds every administrative permission the running release publishes, one a later release adds included, and the seeded Administrator role lists *, which is everything. Because nobody holds today what such a role holds tomorrow, only an administrator who may change roles over the whole deployment gives one, or provisions a credential for somebody who holds one — so give the people an organization's administrator looks after roles that list names. A pattern in a role's list holds the syntax and the rule.

A row the deployment will not read is named rather than hidden. A user record, a mail account declaration, or an organization row written by an older build, edited in the database, or restored from a backup may stop reading as one — and each of them costs only itself, so nothing else tells you. mfctl organization list names any organization row in that state beneath the listing, and records this deployment will not read is the route that reports all three kinds with the settings to correct.

A person served this way maintains the folders of the mailboxes assigned to them from the client without reaching this command at all — and sees only their own. Who else a deployment serves is administrative, and no surface a person signs in to publishes it.

Administering a deployment is the operator's reference for every route behind these commands.

Changing a setting without a restart

Most of what MailFathom reads comes from the files your deployment provisioned, and those stay yours: nothing in the process edits one. What a deployment persists for itself is a document in the database, layered above those files, and mfctl config is where you read and change it:

$ mfctl config show MailboxSearch
MailboxSearch:
  SnippetsPerEmail = 3 [file (10-deployment.json)]
  WordsPerSnippet = 12 [persisted-layer]
2 settings, over persisted configuration version 7.

$ mfctl config set MailboxSearch:SnippetsPerEmail 5

Every value comes with where it was decided, and that is half the answer. A deployment reads its settings from files, from that persisted document, and from an environment variable or a command-line argument somebody put beside the process — so before changing anything, the reading tells you which of those you would actually have to edit. A value an environment variable is supplying is refused rather than persisted, naming the source that outranks the persisted layer, because persisting it would spend a version and change nothing you read.

mfctl config unset gives one setting back to the file beneath it. mfctl config edit opens the whole persisted document in your $VISUAL or $EDITOR and commits what you saved as one change, which is what you want when a change spans half a section — set it up as VISUAL="code --wait" if your editor is a graphical one, since the command reads the file back when the editor exits; --format yaml opens it as YAML instead. And mfctl config adopt copies what your files decide beneath a path into the database, which is the one thing here that stops a file deciding a value; it shows you exactly what it would take and asks first.

A setting that holds a credential reads back as (redacted) everywhere, including in the editor — the document holds a reference to where the material is kept rather than the material, and neither reaches your screen.

Configuration sources is the whole of what a write proves before it commits and every refusal it can answer with.

Where to go next