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:
Radosław Smoliński
2026-11-26 00:46:16 +01:00
co-authored by Claude Fable 5.2
parent acfcf72c03
commit 49927205bb
30 changed files with 443 additions and 119 deletions
+12 -7
View File
@@ -54,13 +54,18 @@ Mail needs **no variable**. A site with no SMTP server in the panel sends throug
- **That route reachable from the internet** — no basic auth on the Coolify app, no firewall or WAF rule in front of
`/api/iapl/`; behind Cloudflare leave it uncached and unchallenged.
- **Outbound HTTPS** to `webservices.intecion.net`.
- **Staging.** A site is active as soon as it enrols, so a staging site sends real mail. A staging site made from a
**copy of production's database** does not connect by itself (its data is production's; it stays "not connected"
until an admin presses "Connect again") and never uses or touches production's connection. The safe set-up for a
copy that must not send: `iapl({ mail: { relay: false } })` or SMTP to a catcher ([email.md](./email.md)
"Staging, copies and several hosts").
- **A domain move** (the same database under a new host): press "Connect again" once after the move, or set
`mail: { relay: { otherHosts: ['old-domain.example'] } }` before it.
- **Launch and a domain move need nobody.** A site built on a development address and then served on its real
domain (or moved to another one) enrols by itself on its first e-mail; the old address's connection in the
database is its own past. Remove `IAPL_NOINDEX` at launch as always — a site that still has it counts as a
non-public copy and sends nothing.
- **Staging and copies.** A site is active as soon as it enrols, so a staging site sends real mail. A **copy of
production's database** on a site that says it is not public — `IAPL_NOINDEX=1` (set on every staging, preview and
test copy) or a host in `mail: { relay: { developmentHosts: ['*.dev.agency.example'] } }` — neither enrols nor
sends by itself (its data is production's) until an admin presses "Connect again", and never uses or touches
production's connection. **A copy without either mark sends**, to the real addresses in its data: the plugin
cannot tell it from launch day (the doctor's deep run notes it). The safe set-up for a copy that must not send:
`iapl({ mail: { relay: false } })` or SMTP to a catcher ([email.md](./email.md) "Staging, copies and several
hosts").
- Several containers of one site share the database, so they share the token; a restore of an old database dump
brings back an old token — the site then enrols again by itself on its next e-mail.