Mail relay: docs, agent guide, skills, changelog draft; test against the real service code; starter offers the mail service
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
533f571d4d
commit
dd3792cbc7
@@ -996,6 +996,26 @@ document, the fields under `version`, where field hooks do not run: the global's
|
||||
the form without touching the field → a test e-mail still goes out; change the server without typing the
|
||||
password → the save is refused with "Enter the password again…".
|
||||
|
||||
## The mail service's token and its public route (`mail.relay`)
|
||||
|
||||
A site that sends through the Intecion Notifications Webservice ([email.md](./email.md)) holds one secret: its own
|
||||
token. What protects it, and what the new public route can and cannot do:
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| **No key in the package** | The plugin carries the service's address and nothing else. A site gets its token by proving it is served at its host: it makes a nonce, the service calls `POST https://<host>/api/iapl/mail-relay/confirm` with the nonce and a token, and only an answer that hashes both makes the token valid |
|
||||
| **Where the token is** | `payload-kv`, key `iapl:mail-relay`. The collection refuses every operation through access control (`read`, `create`, `update`, `delete` are `false`) and is hidden: REST, GraphQL and the panel cannot reach it — an admin included (test: `test/mailRelayHttp.test.ts`). Server code with the Local API can, like `smtpPassword`. It is stored as it is (no encryption at rest), never logged, never sent to a browser, never part of a route's answer |
|
||||
| **A token read from a database dump** | does not work from another server: the service accepts a token only from the addresses the site enrolled from (IPv6: the same `/64`) and answers anything else "enrol again" — which needs the call-back to the real site. It cannot send as another site, and the limits below apply |
|
||||
| **What a token can do at most** | send within the site's limits (30 an hour, 200 a day, 10 recipients, 10 MB by default) from the service's fixed address, under a sender name the service checks, with `X-Intecion-Site: <host>` on every mail. It cannot set `From`, `Return-Path` or any header, and cannot address a security alert |
|
||||
| **The confirm route** | public by design, `404` with an empty body unless the body carries a nonce **this site** made in the last 5 minutes (kept as a hash, compared in constant time, single use). It stores the delivered token **beside** the one in use and never replaces a working token: a token becomes the one in use only after the service has accepted it. Rate-limited per address (10 a minute, `mail.relay.confirmRateLimit`). A stranger who calls it learns nothing and changes nothing |
|
||||
| **Who can start an enrolment** | the server itself (a send without a token) and an admin ("Connect again"). The three state routes need the `admin` role and answer with states only |
|
||||
| **A site taken over by an attacker with admin rights** | can send mail through the service under any sender name the service's check lets through, within the limits — as it could through the site's SMTP server. Intecion sees the host on every mail and can suspend the site (`relay-suspended`) |
|
||||
| **Visitors** | cannot reach the service: only the server calls it. What a visitor can trigger is a form's mail (rate limit, Turnstile) and "forgot password" — limited by the site per address and per visitor (`mail.relay.accountMail`), because the service does not limit account mail per address |
|
||||
| **A subject or name typed by a visitor** | line breaks, control characters, direction marks and other invisible characters are removed before the message leaves (`cleanSubject`); recipients are reduced to bare addresses; a message has no header field |
|
||||
|
||||
Turn off: `iapl({ mail: { relay: false } })` — no route, no outbound call, no token. Give the token up:
|
||||
"Disconnect" in the panel (`disconnectRelay`), which revokes it on the service at once.
|
||||
|
||||
## Dashboard alerts by role (`dashboardAlerts`)
|
||||
|
||||
The plugin's dashboard alerts read data that only some roles may read (with access control off, on the server),
|
||||
@@ -1015,6 +1035,9 @@ the full text, as before. The components take the same as props
|
||||
`ownOrigins` are exported. **Verify count:** `verifyLimit: { store: 'memory' }`; `buildVerifyLimit`,
|
||||
`verifyLimitKey`, `clearVerifyLimits` (tests) are exported.
|
||||
- **Dashboard alerts:** `dashboardAlerts: { integrations, cookies }`.
|
||||
- **The mail service:** `mail: { relay: false }`; `mail.relay: { enrol: 'manual' | false, token, accountMail,
|
||||
confirmRateLimit }`; `relayConfirmEndpoint`, `enrolRelay`, `disconnectRelay`, `rotateRelayToken`, `setRelayToken`
|
||||
are exported ([email.md](./email.md)).
|
||||
- **Verify limit:** `twoFactor.verifyLimit: { max, windowMinutes }`, or `false`.
|
||||
- **`back` link check of the 2FA screens:** `twoFactor.safeBack: false`, or a function as your own rule;
|
||||
`safeAdminBack`, `wrapTotpViews`, `copyViews`, `changedViewKeys`, `SAFE_TOTP_VIEW`, `SafeTotpView` are exported.
|
||||
|
||||
Reference in New Issue
Block a user