Mail relay: review round 2 — the store is keyed by host, a copied database does not enrol by itself
- Q-1 one entry per host (iapl:mail-relay:site:<host>); a read never deletes or writes; another host's
entry is neither used nor touched (a developer's process on the live database, www and apex, a copy)
- a database that holds another host's connection and none of this site's does not enrol by itself:
"Connect again" does, once; mail.relay.otherHosts ('wait' | 'enrol' | the site's own other hosts);
panel text and doctor finding; a site with an empty store enrols by itself as before
- Q-2 the file limit answers from what is stored and never asks the service
- Q-3 a file whose mail was not confirmed is not reported as a wrong file, and no notice mail follows
- Q-4 its own text when the access-key field is off
- D-1 docs for open enrolment; staging, copies and several hosts
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
edee3a321f
commit
85ed92bb89
@@ -102,8 +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") |
|
||||
| staging sends nothing after its database was copied from production: "Not connected yet" / "waiting for approval" | expected: production's token is tied to production's host and is not used on the copy; the copy enrolled as itself | Intecion approves the staging host, or staging uses SMTP / `mail: { relay: false }` |
|
||||
| `relay-pending` / "waiting for approval" | the host is not on Intecion's list | Intecion approves it on the service; nothing to change on the site; the same token then works |
|
||||
| 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 |
|
||||
| `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 |
|
||||
| `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 |
|
||||
|
||||
@@ -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" ("waiting for approval" = ask Intecion to approve the host), 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 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
|
||||
`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.
|
||||
|
||||
@@ -571,8 +571,11 @@ PROGRAMISTA §6, item 73; email.md; AGENT.md §7.2) — nothing to run; read whi
|
||||
`iapl({ mail: { relay: false } })`.
|
||||
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); Intecion has listed
|
||||
the host (otherwise "waiting for approval"); the client's processing agreement names the service.
|
||||
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'] } }`.
|
||||
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