Mail relay: review of 7d766b6 — R-1 to R-12, four mutations, two sentences

- R-1 a delivered token becomes the one in use only on 200 or a refusal given after authentication
- R-2 a token of another site is refused by what /v1/status says (access-key field, scripts); docs for staging
- R-3 the confirm route looks the nonce up first and counts only refused calls
- R-4 one budget of time per message (10 s, 30 s with files), enrolment and retries included
- R-5 'Disconnect' without the service's answer is not confirmed and keeps the token to try again
- R-6 no enrolment without the confirm route in the config
- R-7 half an SMTP set-up: one log line and a hint in the panel
- R-8 to R-10, R-12 docs; R-11 the last failure stays in the state block
- tests for redirect: manual, the candidate's nonce, the expectation taken back, one recipient only

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 22:07:10 +01:00
co-authored by Claude Fable 5.2
parent 0ee74ab2a4
commit a2b07b1dc1
23 changed files with 584 additions and 69 deletions
+5 -1
View File
@@ -110,7 +110,11 @@ through this procedure. Ask only when you are missing something you cannot get y
| `relay-too-large` / `relay-attachment-refused` | files over the service's limit (10 MB a message); a program or script as attachment | lower the File field's maximum (`iapl-form`); other file types; SMTP for larger files |
| `relay-recipient-suppressed` | one recipient's mailbox bounced or complained before (for any site); nothing was sent to anybody | correct the address in the form's Emails tab; ask Intecion to clear the address |
| `relay-unreachable` | the service or its mail back end failed, or the server cannot reach `webservices.intecion.net` | `curl -s https://webservices.intecion.net/mail/health` from the server → `{"ok":true}`; if it persists: SMTP, and tell Intecion |
| `relay-not-confirmed` / "may have been sent" | no answer from the service (time-out, connection lost) | check the recipient's mailbox **before** sending again; the same message sent again cannot double |
| `relay-not-confirmed` / "may have been sent" | no answer of the service: a time-out, a lost connection, an error page of a proxy in front, or the message's time budget (10 s, 30 s with files) ran out while an attempt was open | check the recipient's mailbox **before** sending again — a repeat after a restart or from another instance is a new message and can double. A service that hangs for everybody: SMTP meanwhile, tell Intecion |
| state block: "the disconnection is not confirmed" | "Disconnect" could not reach the service: the site stopped sending, the token still works there | press "Disconnect" again when the service answers |
| "This access key belongs to another site" | a token issued for another host was pasted | ask Intecion for a token for this host |
| `relay-refused`, cause `client-no-route` | the config has no `POST /api/iapl/mail-relay/confirm`: `mailAdapter()` without `iapl()`, or beside `mail: { relay: false }` | use the plugin option, or add `relayConfirmEndpoint()` to `endpoints` |
| log: "The SMTP settings in Site integrations are incomplete" | server, user name or password is missing, so the mail service carries the mail | complete the three fields, or empty them |
| `relay-error` | the service refused the request as wrong (a bug), or the message has no valid recipient or no body | server log line `[iapl] mail service: …` → `iapl-plugin-gap` |
| the mail arrives under the site's host instead of the client's name | the service did not accept "Sender name" (an address, a bank or provider name, mixed scripts, over 64 characters) — the state block says which name was used | another name; an honest name that is still replaced → Intecion |
| replies to the site's mail are lost | "Sender address" is empty: the service's own address has no mailbox | fill it in (doctor: `mail-reply-address`) |
@@ -554,13 +554,16 @@ builds; the panel opens; the old commands (`pnpm exec ipal-doctor`) still run.
**→ 1.17.0, e-mail (the Intecion mail service (IWSN in the panel) is the default transport; Microsoft Graph deprecated; CHANGELOG 1.17.0;
PROGRAMISTA §6, item 73; email.md; AGENT.md §7.2) — nothing to run; read which case the site is:**
1. **Every site:** no schema change, no migration, no import-map change. The e-mail tab gains the block "How e-mails
1. **Every site:** no schema change, no migration, no import-map change. `pnpm payload generate:types` gives a small diff
(four field descriptions of Site integrations): run it and commit, or a CI that compares types fails. The e-mail tab gains the block "How e-mails
are sent" and new wording ("Automatic", "Own SMTP server").
2. **Which case** — Site integrations → E-mail sending, and the Coolify env:
- **SMTP filled in** (server, user name, password): nothing changes, the site contacts nobody. Done.
- **`GRAPH_*` set:** mail as before; one deprecation warning per start, doctor warning `mail-graph-deprecated`.
Do **not** remove the variables in passing — moving the site is the owner's decision (email.md "Moving off
Microsoft Graph"). Note: with `GRAPH_*` set and SMTP filled in, the panel's choice decides as before.
- **SMTP half filled in** (a server or user name without the rest; refused until now): mail now goes through the
mail service, with one log line and a hint in the panel — complete or empty the fields.
- **Neither** (mail failed with "not configured" until now): **on its next e-mail the site contacts
`webservices.intecion.net` with its host and the plugin version**, receives its own token through the new public
route `POST /api/iapl/mail-relay/confirm`, and from then on sends from `[email protected]`