Mail relay: launch and a domain move need no click; a non-public copy neither enrols nor sends by itself
The copy rule now goes by direction. A public site that finds another host's connection in its database (its development address after launch, its old domain after a move) enrols by itself. A site that says it is not public - IAPL_NOINDEX=1, or a host in the new mail.relay.developmentHosts - and holds another host's connection is a copy of that site's data: it neither enrols nor sends until "Connect again", also when it has a token of its own (production's database copied back onto the development address). The consent is stored with the copy (acceptedHosts), so the next fresh copy waits again. - mail.relay.otherHosts: 'auto' (default) | 'wait' | 'enrol' | list of the site's own hosts - mail.relay.developmentHosts, siteIsNonPublic() exported - the copy refusal ends when its reason does (no cool-down; the panel recomputes it on every read) - doctor: info for a public site whose database knows another host (the launched site, or a copy that forgot IAPL_NOINDEX) - contract copy 1.7.1 (wording only) - docs, AGENT.md, skills, changelog draft Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
acfcf72c03
commit
49927205bb
@@ -102,7 +102,8 @@ through this procedure. Ask only when you are missing something you cannot get y
|
||||
| `relay-refused` / "The mail service could not reach this site at …" (cause `callback-failed`) | `unreachable` / `timeout`: firewall, private network, wrong public host in `serverURL`; `redirect`: `trailingSlash: true`, apex → `www`, a language redirect; `status`: route blocked, missing (`mail: { relay: false }`?) or another `routes.api`; `confirmation`: a proxy rewrites the answer | `curl -i -X POST https://<host>/api/iapl/mail-relay/confirm -d '{}' -H 'content-type: application/json'` must answer **404 with an empty body, no redirect**; fix `serverURL` / `mail.relay.host`, or ask Intecion to set the site's confirm address (path ending in `/confirm/` with trailing slashes); then "Connect again" (the site does not retry by itself for 15 min). email.md "When the site cannot be confirmed" |
|
||||
| `relay-refused`, cause `host-not-allowed` / "This site has no public address yet" | the site runs on `localhost`, a private name, or `serverURL` is empty | expected in development (use SMTP / Mailpit there); in production set `serverURL` |
|
||||
| `relay-refused` on a site whose token was entered by hand ("does not know the server this site now runs on" / "access key … no longer valid") | the site moved or got a second server, or its token expired; a site with a hand-issued token cannot enrol by itself | Intecion adds the server's address, or issues a new token — set it with `setRelayToken(payload, token)` from a script (`pnpm payload run`), or in the panel when the project has `mail.relay.accessKeyField: true` (email.md "The token") |
|
||||
| a site sends nothing: "The data comes from another site (…), so this site did not connect by itself" / `relay-refused`, cause `client-other-host` | the database holds another host's connection and none of this site's: a staging copy of production, a moved domain, a second domain. Expected — a copy with production's data must not mail real people by itself | should it send: "Connect again" in the state block, once. A moved or second domain: `mail: { relay: { otherHosts: ['old-domain.example'] } }`. A copy that must never send: `mail: { relay: false }` or SMTP to a catcher |
|
||||
| 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 says it is not public (`IAPL_NOINDEX=1`, or a host in `mail.relay.developmentHosts`) 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 |
|
||||
| a staging or test copy **does** send, to real addresses | it does not say it is not public, 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" | `IAPL_NOINDEX=1` on the copy, or `mail: { relay: { developmentHosts: ['*.dev.agency.example'] } }`; to be sure: `mail: { relay: false }` or SMTP to a catcher |
|
||||
| `relay-pending` / "waiting for approval" | the exception: the service holds new sites for approval when many appear at once, or Intecion approves by hand (a site is normally active as soon as it enrols) | Intecion approves it on the service; nothing to change on the site; the same token then works |
|
||||
| `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 |
|
||||
|
||||
@@ -646,7 +646,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). SMTP fields **only** when the client asked
|
||||
for its own server. On the production domain: the block "How e-mails are sent" must say "Connected to IWSN" (a site is active as soon as it enrols; "waiting for approval" is the exception — ask Intecion; "The data comes from another site" = this database is a copy: press "Connect again" only if the copy should send), then **Send test e-mail** → "through IWSN". Turnstile (for testing site
|
||||
for its own server. On the production domain: the block "How e-mails are sent" must say "Connected to IWSN" (a site is active as soon as it enrols; "waiting for approval" is the exception — 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 says it is not public (`IAPL_NOINDEX=1` or a development host) 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 staging or test copy must have `IAPL_NOINDEX=1` (or its host in `mail: { relay: { developmentHosts: […] } }`), 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.
|
||||
|
||||
@@ -573,9 +573,13 @@ PROGRAMISTA §6, item 73; email.md; AGENT.md §7.2) — nothing to run; read whi
|
||||
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. Nothing to arrange with Intecion: the site is active as soon as it enrols.
|
||||
**A staging copy of the database** does not connect by itself (it would mail production's real addresses): it
|
||||
says so in the panel until an admin presses "Connect again"; keep it silent with `mail: { relay: false }` or SMTP
|
||||
to a catcher. After a domain move: "Connect again" once, or `mail: { relay: { otherHosts: ['old-domain.example'] } }`.
|
||||
**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
|
||||
**if it says it is not public** — `IAPL_NOINDEX=1` (check that every copy has it) or its host in
|
||||
`mail: { relay: { developmentHosts: ['*.dev.agency.example'] } }`: the panel says so until an admin presses
|
||||
"Connect again". A copy with neither mark sends to the real addresses in its data; keep a copy silent for good
|
||||
with `mail: { relay: false }` or SMTP to a catcher. Production must not have `IAPL_NOINDEX` set (it would send
|
||||
nothing).
|
||||
4. Code that compared the result of `payload.sendEmail` needs no change for SMTP and Graph. A send through the mail
|
||||
service returns `{ sent, transport: 'relay', … }`; `sent: false` with `confirmed: false` means "may have been sent".
|
||||
5. Your own account mail (invitations): mark it — `withMailKind(message, 'account')`. Form mail and Payload's
|
||||
|
||||
Reference in New Issue
Block a user