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:
Radosław Smoliński
2026-11-25 23:14:11 +01:00
co-authored by Claude Fable 5.2
parent edee3a321f
commit 85ed92bb89
31 changed files with 467 additions and 211 deletions
+9
View File
@@ -39,6 +39,15 @@ export type RelayOptions = {
host?: string
/** The kind of a message that carries no mark of its own; return undefined to keep the default (`system`). */
kind?: (message: SendEmailOptions) => MailKind | undefined
/**
* What a site does when its database already holds the connection of ANOTHER host and none of its own —
* the sign of a copied database (staging made from production), of a moved domain, or of two sites on one
* database. Default `'wait'`: the site does not enrol by itself (a copy with production's data would start
* mailing real people); an admin presses "Connect again", once. `'enrol'`: enrol by itself all the same.
* A list: these hosts are this site's own (its old domain, its second domain) — beside them it enrols by
* itself, beside any other it waits. `www.` and the bare domain are always one site.
*/
otherHosts?: 'enrol' | 'wait' | string[]
/**
* The wait before the next attempt when the service names none, in ms, multiplied by the attempt's
* number. Default 1000. The ten seconds of waiting in all are not changed by it. Mostly for tests.