IWSN: "Połącz z IWSN" — a person of Intecion connects the site (contract 1.8.0)
- the state block on the e-mail tab (method IWSN): the button while the service offers the confirmation page
(connectAvailable) or before the site has enrolled; a click asks the site's server for the link
(POST /api/iapl/mail-relay/connect-link, admin only), which asks the service (POST /v1/connect, enrolling first),
checks that it begins with the service's own {base}/connect?, and hands it over without storing or logging it;
the browser opens it in a new tab with noopener noreferrer; the block asks /v1/status every 5 s for 10 min
- states: waiting for confirmation (button), waiting for approval (no page), connected, stopped; 503
connect-unavailable and 429 said in the admin's language; a load of the panel asks the service while the site waits
- dashboard alert for a waiting site (live); doctor mail-relay-connect (error) — replaces the pending warning and the
"not enrolled yet" note of mail-relay-state
- opt-out mail.relay.connectButton: false (no button, no route); building blocks requestRelayConnectLink,
isRelayConnectUrl, RELAY_CONNECT_LINK_PATH; the fake service implements /v1/connect, connectAvailable and
confirmConnect
- contract copy 1.8.0 (IWDL working tree, checksums match); docs, AGENT.md, setup / upgrade / debug skills, changelog
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
347e3bafa1
commit
2c0262367d
+8
-2
@@ -1363,8 +1363,12 @@ reports `mail-method` info (nothing picked yet) or nothing (picked and usable).
|
||||
3. The server may call `https://webservices.intecion.net`.
|
||||
4. Site integrations → E-mail sending: "Sender name" (else the site name is used) and **"Sender address"** — with
|
||||
the mail service that is where replies go; the service's own address has no mailbox.
|
||||
5. Nothing to arrange with Intecion: a site that passes the call-back is active at once (`relay-pending`, held for
|
||||
approval, is the exception — the panel says so).
|
||||
5. **A person of Intecion connects the site** (contract 1.8.0): after its first e-mail (or the button) the site waits
|
||||
(`relay-pending`). Site integrations → E-mail sending → **"Połącz z IWSN"** opens the service's confirmation page in a
|
||||
new tab; a person of Intecion signs in with an `@intecion.com` address and presses "Potwierdź"; the block shows
|
||||
"Connected to IWSN" by itself (it asks every 5 s for 10 min, and on every load while the site waits). Tell the owner
|
||||
that step is theirs. Nothing to paste, no token. Opt-out: `mail: { relay: { connectButton: false } }` (no button, no
|
||||
route). **Verify:** `iapl-doctor --deep` has no `mail-relay-connect` error; a test e-mail answers "through IWSN".
|
||||
6. **Launch needs nobody:** a site enrolled on its development address and then served on the real domain (or moved
|
||||
to another domain) enrols by itself on its first e-mail. **A non-public copy does not send by itself:** a site
|
||||
whose host matches `iapl({ developmentHosts })` — default `['*.dev.netscale.pl']`, Intecion's development
|
||||
@@ -1414,6 +1418,7 @@ overrides per adapter; `resolveRelayOptions` reads what is in effect):
|
||||
| `otherHosts` | `'auto'` | a database holding another host's connection: a public site enrols by itself (launch, a move), a non-public one (`IAPL_NOINDEX=1` / `developmentHosts`) neither enrols nor sends until "Connect again"; a list of the site's own other hosts; `'wait'` (a public site without a connection waits too); `'enrol'` (no rule) |
|
||||
| `developmentHosts` | `iapl({ developmentHosts })`, default `DEFAULT_DEVELOPMENT_HOSTS` = `['*.dev.netscale.pl']` (`pluginDevelopmentHosts`) | host patterns (`*`) of development and staging addresses, for the mail service alone: a site there is non-public for `otherHosts` with no env (`siteIsNonPublic`, `siteNonPublicSignal` → `NonPublicSignal`, `matchDevelopmentHost`, `isDevelopmentHost`); `[]` = none. Checked when the config is built (`assertDevelopmentHosts`): not an array of non-empty host patterns, or a lone `*` → the site does not start; Unicode patterns are punycoded, a trailing dot and the port are ignored |
|
||||
| `enrol` | `'auto'` | `'manual'` (only "Connect again" / `enrolRelay`), `false` (token from `token` / `setRelayToken`) |
|
||||
| `connectButton` | `true` | `false`: no "Połącz z IWSN" and no `POST /api/iapl/mail-relay/connect-link`; confirm by an operator or with `requestRelayConnectLink` |
|
||||
| `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 |
|
||||
@@ -1447,6 +1452,7 @@ needs more: Intecion raises the limits, or SMTP.
|
||||
|---|---|
|
||||
| The transport alone, no SMTP / Graph | `email: relayAdapter()` (`RelayAdapterArgs`) |
|
||||
| Enrol from a deploy script; state; rotate; disconnect; a token issued by hand | `enrolRelay` (`EnrolResult`), `getRelayStatus` (`RelayStatus`), `rotateRelayToken`, `disconnectRelay`, `setRelayToken` |
|
||||
| A button of your own for the confirmation by Intecion | `requestRelayConnectLink(payload)` (`ConnectLinkResult`: `{ state: 'pending', connectUrl, expiresAt }` / `{ state: 'active' }` / a refusal) on a person's click only; open `connectUrl` in a new tab with `noopener noreferrer`; never store, log or fetch it; `isRelayConnectUrl(url, base)`; the route `RELAY_CONNECT_LINK_PATH`; the stand-in `createFakeRelay({ connect })` + `relay.confirmConnect(url)` |
|
||||
| Your own state block or panel route | `mailPanelState` (`MailPanelState`), `relayPanelEndpoints`, `relayConfirmEndpoint`; the plugin's component is `MailRelayStatus` (`/admin`) |
|
||||
| One message with the retry rule; one HTTP call | `sendThroughRelay` (`RelaySendContext`, `RelaySendResult`), `relayRequest` (`RelayCall`, `RelayAnswer`, `RelayRefusal`) |
|
||||
| The request the service takes | `buildRelayMessage` (`BuildRelayMessageArgs`, `BuiltRelayMessage`, `RelaySendRequest`), `bareAddress`, `bareAddresses`, `cleanSubject` |
|
||||
|
||||
@@ -122,7 +122,7 @@ through this procedure. Ask only when you are missing something you cannot get y
|
||||
| a site sends nothing: "The data comes from another site (…), so this copy does not send e-mails by itself" / `relay-refused`, cause `client-other-host` | the site is non-public — its host matches `developmentHosts` (built in: `*.dev.netscale.pl`) or `IAPL_NOINDEX=1` is set; `iapl-doctor --deep` says which (`mail-non-public`) — and its database holds another host's connection: a staging copy of production, or production's data copied back onto the development address. Expected — a copy with production's data must not mail real people by itself | should it send: "Connect again" in the state block, once (until the data is replaced). A copy that must never send: `mail: { relay: false }` or SMTP to a catcher. **The production site itself says this:** `IAPL_NOINDEX` was left set after launch — remove it; or its host matches a development pattern — take it out of `iapl({ developmentHosts })` |
|
||||
| the site does not start: "[iapl] … developmentHosts must be an array of host patterns …" | the list is not an array of non-empty host patterns (a single string, `null`, `['']`), or holds a lone `*` | write it as `['*.dev.netscale.pl', 'staging.client.pl']`; `[]` = none; to change who waits use `mail.relay.otherHosts` |
|
||||
| a staging or test copy **does** send, to real addresses | its host matches no development pattern and it has no `IAPL_NOINDEX=1`, so it looks like a launch (a public site enrols by itself); the doctor's deep run notes "the database also holds the mail-service connection of another host" | name its host in `iapl({ developmentHosts: ['*.dev.netscale.pl', '<the copy's pattern>'] })`, or `IAPL_NOINDEX=1` on the copy; to be sure: `mail: { relay: false }` or SMTP to a catcher |
|
||||
| `relay-pending` / "waiting for approval" | while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval; after that, the exception (many new sites at once, or approval by hand) | Intecion approves it on the service; nothing to change on the site; the same token then works |
|
||||
| `relay-pending` / "Waiting for confirmation" / doctor `mail-relay-connect` | a new site waits until a person of Intecion confirms it (contract 1.8.0) | Site integrations → E-mail sending → "Połącz z IWSN"; the person signs in with an @intecion.com address on the page that opens and presses "Potwierdź"; the block turns "Connected" by itself. "Waiting for approval" with no button, or "the confirmation page is not available": Intecion confirms the host by hand. "Too many confirmation links": wait the minutes it says. The same token works afterwards |
|
||||
| `relay-suspended` | Intecion stopped the site (abuse, a flood from a form) | contact Intecion; fill in SMTP meanwhile |
|
||||
| `relay-disconnected` | an admin pressed "Disconnect" | "Connect again", or SMTP |
|
||||
| `relay-quota` | the site's hour or day is used up (30 / 200 by default), more than 10 recipients, more than 10 confirmations to one address a day, too many new addresses, or the site's own limit on account mail (`mail.relay.accountMail`) | the server log names the limit; look for a form being abused (Turnstile on? rate limit?); a site that really sends more: Intecion raises the limits, or SMTP |
|
||||
|
||||
@@ -669,7 +669,7 @@ scaling (5). `●` routes for pages need the database at build time (PROGRAMISTA
|
||||
6. **Notifications**: form messages in every language.
|
||||
7. **Site integrations → E-mail sending**: "Sender name" (the client's name; empty = the site name) and **"Sender
|
||||
address"** (the client's address: with the mail service replies go there). "Sending method" stays **IWSN (built-in)**; choose **Own SMTP server** and fill in its fields **only** when the client asked
|
||||
for its own server — what is chosen is what is used, an incomplete SMTP server sends nothing. A new site sends through IWSN with nothing picked; picking another option and saving stores it (the panel warns before the save when its settings are incomplete). On the production domain: the block "How e-mails are sent" must say "Connected to IWSN" ("waiting for approval": while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval — ask Intecion to approve the host; under open enrolment it is the exception; the real domain enrols by itself at launch although the site was connected on its development address — nothing to press; "The data comes from another site" = the site is non-public (its host matches `developmentHosts`, built in `*.dev.netscale.pl`, or `IAPL_NOINDEX=1`) and holds a copy of another site's data: press "Connect again" only if the copy should send — on the production domain it means `IAPL_NOINDEX` was left set. A development address under `*.dev.netscale.pl` needs nothing; a staging or test copy on any other host must have its host in `iapl({ developmentHosts: […] })` (an array of host patterns: a single string, an empty entry or a lone `*` stops the start) or `IAPL_NOINDEX=1`, or it mails the real addresses in its data), then **Send test e-mail** → "through IWSN". Turnstile (for testing site
|
||||
for its own server — what is chosen is what is used, an incomplete SMTP server sends nothing. A new site sends through IWSN with nothing picked; picking another option and saving stores it (the panel warns before the save when its settings are incomplete). On the production domain: the block "How e-mails are sent" must say "Connected to IWSN" ("Waiting for confirmation": press "Połącz z IWSN" and have a person of Intecion confirm the site on the page that opens — the owner's step, @intecion.com sign-in; "waiting for approval" with no button: ask Intecion; the real domain enrols by itself at launch although the site was connected on its development address — nothing to press; "The data comes from another site" = the site is non-public (its host matches `developmentHosts`, built in `*.dev.netscale.pl`, or `IAPL_NOINDEX=1`) and holds a copy of another site's data: press "Connect again" only if the copy should send — on the production domain it means `IAPL_NOINDEX` was left set. A development address under `*.dev.netscale.pl` needs nothing; a staging or test copy on any other host must have its host in `iapl({ developmentHosts: […] })` (an array of host patterns: a single string, an empty entry or a lone `*` stops the start) or `IAPL_NOINDEX=1`, or it mails the real addresses in its data), then **Send test e-mail** → "through IWSN". Turnstile (for testing site
|
||||
`1x00000000000000000000AA`, secret `1x0000000000000000000000000000000AA`; production keys from the client), analytics/pixel
|
||||
IDs, IndexNow → generate key. Mail/Turnstile errors show up as a dashboard alert.
|
||||
8. **Forms**: check the addresses in the Emails tab of the seeded forms.
|
||||
|
||||
@@ -714,7 +714,7 @@ PROGRAMISTA §6, items 73–75; email.md; AGENT.md §7.2) — nothing to run; re
|
||||
3. **For a site that will use the mail service:** `serverURL` is the public address the site answers on without a
|
||||
redirect; no proxy or WAF rule blocks `/api/iapl/mail-relay/confirm`; `trailingSlash: true` or another `routes.api` →
|
||||
Intecion sets the site's confirm address first; "Sender address" is filled in (replies go there); the client's
|
||||
processing agreement names the service. Tell Intecion the host: while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval (the panel says "waiting for approval"); under open enrolment a site is active as soon as it enrols.
|
||||
processing agreement names the service. A new site waits until a person of Intecion confirms it: "Połącz z IWSN" in the panel (contract 1.8.0).
|
||||
**Launch and a domain move need nothing:** the real domain enrols by itself although the database holds the
|
||||
development address's connection. **A staging or test copy of the database** neither enrols nor sends by itself
|
||||
**when it is non-public**: its host matches `iapl({ developmentHosts })` — built in `*.dev.netscale.pl`, so the
|
||||
@@ -736,7 +736,16 @@ PROGRAMISTA §6, items 73–75; email.md; AGENT.md §7.2) — nothing to run; re
|
||||
**Check:** `pnpm exec iapl-doctor --deep --url <site>` → no `mail-transport` / `mail-relay-state` / `mail-reply-address` /
|
||||
`mail-relay-route` finding (or only `mail-graph-deprecated` on a Graph site); Site integrations → E-mail sending →
|
||||
**Send test e-mail** names the transport you expect; a form submission arrives. **The service is live at
|
||||
`https://webservices.intecion.net/mail`; while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval — keep SMTP until it is approved, or `relay: false`.**
|
||||
`https://webservices.intecion.net/mail`; a new site waits until a person of Intecion confirms it ("Połącz z IWSN") — keep SMTP until then, or `relay: false`.**
|
||||
|
||||
**→ 1.18.0, IWSN is connected by a person of Intecion (CHANGELOG "Unreleased (for 1.18.0)" → "IWSN: Połącz z IWSN"; email.md "The mail service"; AGENT.md §7.2 point 5) — nothing to run:**
|
||||
1. No schema change, no migration, no import-map change. Sites whose "Sending method" is SMTP or Microsoft Graph see no
|
||||
change at all.
|
||||
2. A site on IWSN that is already active stays active. A site that waits (`relay-pending`, or doctor `mail-relay-connect`
|
||||
error after the upgrade): Site integrations → E-mail sending → **"Połącz z IWSN"** → a person of Intecion confirms
|
||||
it on the page that opens (an @intecion.com sign-in — the owner's step, tell them) → the block says "Connected to
|
||||
IWSN" by itself. Then send a test e-mail.
|
||||
3. A project that does not want the button: `mail: { relay: { connectButton: false } }` (no button, no route).
|
||||
|
||||
**→ 1.17.1, e-mail (CHANGELOG 1.17.1 point 5; PROGRAMISTA §6, item 82; email.md "Which transport a send takes"; AGENT.md §7.2) — nothing to run, one check:**
|
||||
1. **MongoDB: no migration. Postgres / SQLite: `pnpm payload migrate:create`** (the new field `emailMethod` is a column),
|
||||
|
||||
Reference in New Issue
Block a user