Mail relay: the built-in client for the Intecion Notifications Webservice

Transport, enrolment with the confirm route, token and state in payload-kv, rotation,
the panel's state block, doctor rules, the fake service and the copied contract 1.5.0.
Tests against the contract's runner and the fake. Docs and HTTP tests follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 20:29:46 +01:00
co-authored by Claude Fable 5.2
parent 9efd86a06f
commit ea9703f8e3
97 changed files with 7720 additions and 48 deletions
+8 -2
View File
@@ -4,12 +4,17 @@ import { userMeetsRole } from '../../modules/access/index.js'
import { INTEGRATION_SECRET_FIELDS, maskSecretsOnRestore, SMTP_PASSWORD_BOUND_TO, writeOnlySecrets } from '../../modules/secrets/writeOnly.js'
import { indexNowFields } from '../../modules/seo/indexNow.js'
import { analyticsFields } from './fields/analytics.js'
import { smtpFields } from './fields/smtp.js'
import { buildSmtpFields } from './fields/smtp.js'
import { turnstileFields } from './fields/turnstile.js'
type BuildSiteIntegrationsArgs = {
/** Extra fields injected by the client project */
additionalFields?: Field[]
/**
* The Intecion mail service is enabled in the project (`mail.relay` is not `false`): the e-mail
* tab shows its state block and says that SMTP is optional. Default true.
*/
mailRelay?: boolean
/**
* A save through access control that changes the SMTP server, port or user name must send the
* password again (or remove it), whatever the transport. Default true; needs write-only
@@ -38,6 +43,7 @@ type BuildSiteIntegrationsArgs = {
*/
export function buildSiteIntegrations({
additionalFields,
mailRelay = true,
reenterSecretOnChange = true,
writeOnlySecrets: writeOnly = true,
}: BuildSiteIntegrationsArgs = {}): GlobalConfig {
@@ -68,7 +74,7 @@ export function buildSiteIntegrations({
fields: secret(turnstileFields),
label: { en: 'Spam protection', pl: 'Ochrona przed spamem' },
},
{ fields: secret(smtpFields), label: { en: 'E-mail sending', pl: 'Wysyłka e-mail' } },
{ fields: secret(buildSmtpFields({ relay: mailRelay })), label: { en: 'E-mail sending', pl: 'Wysyłka e-mail' } },
{ fields: indexNowFields, label: { en: 'IndexNow', pl: 'IndexNow' } },
...(additionalFields?.length
? [{ fields: additionalFields, label: { en: 'More', pl: 'Więcej' } }]