Security¶
A signed-in client reads the mail your token allows it to read, and with the organize scope it can move mail around. What it can never do, whatever the token:
- Send mail. MailFlow's token API has no route for it, and this server has no tool for it.
- Delete mail, or move it into Trash or Junk.
- Reach settings, or an account's server settings. Only the routes in
ALLOWED_CALLSleave the process, so a bug can't reach another one.
flowchart TD
C[MCP client] -->|Sesamcp's token| S[Sesamcp]
S -->|mfat_ token| M[mailflow-mcp]
M -->|mfat_ token| B[MailFlow]
S -.->|stored encrypted| D[(/data)]
Follow the token: the client holds only Sesamcp's. The mfat_… token is stored once, encrypted, in Sesamcp's volume.
Where the gate is¶
mailflow-mcp checks no token when a client connects. It passes on what it is given, and MailFlow judges it on each call. So don't publish it directly: the sign-in in front decides who gets in.
Taking access away¶
- One client: remove its connector. Whether that also ends its login at Sesamcp depends on the client; revoking the token always cuts it off.
- Every client with one token: revoke the token in MailFlow (Settings → Security → API tokens). The next call is refused.
- Everyone: change
MCP_OAUTH_SECRET. All stored logins become unreadable.
Read-only¶
Give the client a token with only the read scope. There is no server setting for it (why).
Mail is untrusted text¶
A message can contain text written to steer an assistant. Read a draft before you send it, and prefer a read-only token where that is enough.