Tenancy: tenants verify the domain names they add (MT-24) #503

Merged
jcoffey-dev merged 1 commits from fix/tenant-domain-verification into main 2026-11-20 18:09:51 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev da404a513a Tenancy: tenants verify the domain names they add (MT-24)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 13m10s
A domain name a tenant administrator adds, as a new domain, a rename
or an alias, now has to be shown to be the tenant's before the server
uses it, and every name counts toward the tenant's maxDomains.

- x:Domain gets unverifiedNames (948) and a read-only, server-set
  verificationToken (949); the stored Domain is version 4. Names saved
  before stay as they are.
- A name a tenant administrator adds is saved as unverified, and the
  domain gets a 32-character token. Until it's verified the name takes
  no mail, isn't a local domain, signs nothing, and gives no addresses
  to send as.
- The tenant verifies a name with a TXT record at
  _inbuxa-verification.<name> carrying inbuxa-verification=<token>,
  then takes it off unverifiedNames; the save looks the record up and
  names it in the refusal if it isn't there. Names a server
  administrator adds need no record, and a server administrator may
  clear or add entries.
- A domain counts as 1 plus its aliases toward maxDomains: on create,
  on an update that adds aliases (under the tenant's write lock), and
  on a move into a tenant.
- Spec: multi-tenancy MT-24. The domain form gets a Verification
  section.

Part of the inbuxa/inbuxa-admin#257 remediation.

Test: registry stored-version tests (version 3 reads back with no
unverified names); TXT matching unit tests; tenant_tests covers an
unverified alias, clears refused without the record and with a wrong
token, a clear with it, the token refused as client-set, aliases over
maxDomains, a tenant-created domain unverified as a whole, and the
server administrator's clear and alias. scim, undelete, legal_hold and
jmap suites pass.
2026-11-20 10:38:09 -07:00