Mail relay: the access-key field is off by default (mail.relay.accessKeyField)
A token issued by hand is set by a developer: setRelayToken() from a script, or mail.relay.token. The panel field and its route take a token only when the project switches the field on. Docs and AGENT.md say when such a token is needed and how to set it; a token of another host is refused on every way in. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
1a11cefffa
commit
edee3a321f
@@ -1316,6 +1316,7 @@ overrides per adapter; `resolveRelayOptions` reads what is in effect):
|
||||
| `url` | `RELAY_BASE_URL` | a relay of your own (same contract) |
|
||||
| `host` | host of `serverURL` (`relayHost`, `isPublicHost`) | the public host the service calls back |
|
||||
| `enrol` | `'auto'` | `'manual'` (only "Connect again" / `enrolRelay`), `false` (token from `token` / `setRelayToken`) |
|
||||
| `accessKeyField` | `false` | `true`: admins get "Enter an access key" in the state block (a hand-issued token) |
|
||||
| `token` | — | a token from elsewhere; nothing is stored, the site does not enrol |
|
||||
| `senderName` | panel → site name (`relaySenderName`) | fixed name or function |
|
||||
| `kind` | — | kind of a message nobody marked |
|
||||
@@ -1354,6 +1355,14 @@ needs more: Intecion raises the limits, or SMTP.
|
||||
| Constants | `RELAY_BASE_URL`, `RELAY_CONFIRM_PATH`, `RELAY_CONTRACT_VERSION`, `RELAY_DEFAULTS`, `RELAY_KV_KEY`, `RELAY_PRODUCT`, `RELAY_SENDER_ADDRESS`, `RELAY_SERVICE_NAME` |
|
||||
| Tests without the service | `createFakeRelay` (`FakeRelay`, `FakeRelayOptions`, `FakeRelayMail`, `FakeRelayLimits`): `mailAdapter({ relay: { url: fake.url, fetchImpl: fake.fetch } })`, then assert on `fake.outbox` |
|
||||
|
||||
**A token issued by hand** is needed only for a site the service cannot call back (behind a firewall or basic
|
||||
auth, on a private network). Intecion issues it for the site's host; you set it, never the client: once from a
|
||||
script — `await setRelayToken(payload, token)` under `pnpm payload run` (stored in `payload.kv`, rotated by the
|
||||
plugin) — or as the deployment's secret, `mail: { relay: { enrol: false, token: () => process.env.MY_MAIL_TOKEN } }`.
|
||||
The panel has no field for it unless the project sets `mail: { relay: { accessKeyField: true } }`. Such a site
|
||||
cannot heal by itself: after a move to another server it reports `relay-refused` until Intecion adds the address
|
||||
or issues a new token. A token of another host is refused on every way in.
|
||||
|
||||
**Never:** read or print the token (`payload.kv`, key `iapl:mail-relay`); add a field or env variable for it; call
|
||||
the service from a client component; retry a failed send in a loop of your own; mark form mail as `account`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user