Mail relay: docs, agent guide, skills, changelog draft; test against the real service code; starter offers the mail service

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 20:53:38 +01:00
co-authored by Claude Fable 5.2
parent 533f571d4d
commit dd3792cbc7
25 changed files with 991 additions and 167 deletions
+23 -4
View File
@@ -9,7 +9,7 @@ zones. This page describes that one path (§4); other hosts — a short note at
Coolify labels below may differ slightly between Coolify versions.
Related: [PROGRAMISTA.md](./dev/PROGRAMISTA.md) (from zero to a working site, §4 deployment),
[env.md](./env.md) (validation at startup), [storage.md](./storage.md) (R2), [email.md](./email.md) (Graph),
[env.md](./env.md) (validation at startup), [storage.md](./storage.md) (R2), [email.md](./email.md) (the mail service, SMTP),
[security.md](./security.md), [integrations.md](./integrations.md) (integration status in the panel).
---
@@ -43,7 +43,23 @@ derives its signing key from it (`sha256(secret)`, first 32 hex characters). Cha
IAPL itself derives nothing from it. Change it only with the owner's OK, at a quiet time, and tell the editors
they will have to log in again.
### Email — Graph (OPTIONAL, agency-level, when transport = Graph)
### Email — nothing in env
Mail needs **no variable**. A site with no SMTP server in the panel sends through the Intecion mail service
([email.md](./email.md)); SMTP is typed in the panel. What the deploy needs for the mail service:
- **`NEXT_PUBLIC_SERVER_URL` / `serverURL` = the public address the site answers on without a redirect** (the service
calls the site back at `https://<host>/api/iapl/mail-relay/confirm` and follows no redirect: with a www ↔ apex
redirect in Coolify, `serverURL` names the side that answers).
- **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`.
- A staging copy on its own domain enrols as its own site (its own token, its own limits, its own approval); a
staging copy that must not send: `iapl({ mail: { relay: false } })` or SMTP to a catcher.
- 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.
### Email — Graph (deprecated since 1.17.0, removed in 2.0; only for sites that already use it)
```bash
GRAPH_TENANT_ID=<azure-tenant-id>
@@ -435,7 +451,7 @@ Files on forms are e-mailed, not stored — **no volume and no bucket** for them
### Integrations in the panel
Mail (SMTP/Graph) and Turnstile errors are visible in the panel after deploy: an alert on the dashboard and a banner on
Mail (the mail service, SMTP, Graph) and Turnstile errors are visible in the panel after deploy: an alert on the dashboard and a banner on
the Site integrations tab — see [integrations.md](./integrations.md).
### Other hosts
@@ -484,7 +500,10 @@ checks with `dig` after propagation. Check on the zone's authoritative server
**Which domain gets SPF/DKIM/DMARC (rows 6–8)** — the one in the **From** address of sent mail:
- **SMTP from the panel** transport → the domain from the *From address* field in Site integrations (usually the client's
domain); the records come from that mailbox's provider;
- **Graph** transport → From is always `GRAPH_SENDER` (agency mailbox, [email.md](./email.md)) —
- **The Intecion mail service** (the default) → From is always `notification@webservices.intecion.net`:
SPF/DKIM/DMARC are Intecion's, set once for that domain. **Nothing is added to the client's DNS zone for it**; the
address from the panel goes into Reply-To;
- **Graph** transport (deprecated) → From is always `GRAPH_SENDER` (agency mailbox, [email.md](./email.md)) —
SPF/DKIM/DMARC are set once for the agency domain, not per project; the address from the panel goes into Reply-To.
Without SPF+DKIM aligned with the From domain (DMARC alignment) form mail lands in spam