Files
SluijsensandClaude Sonnet 5.5 3a9e4ae7aa E-mailfeature Operations: deployment, monitoring, productiegereedheid; configuratiefouten als Error-log
Mislukte mails door een configuratieprobleem (auth_failed, rejected_sender, tls_failed, not_configured) worden
als Error gelogd zodat Sentry een alert stuurt; timeouts en ontvangerproblemen blijven Warning.
Documentatie: uitrol per host met de hand in shared/env, rollback, monitoringplan, checklist; ASF-productie op
IIS als open punt voor een latere feature.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 09:24:19 +01:00

26 lines
2.3 KiB
Markdown

# Deployment instructions - turning mail on for a host
For whoever manages the host (Pi-Main). Do this per host and per environment; credentials never go into the repository, a chat or a ticket.
## Before you start
- The release containing the mail feature is already deployed (a host without mail settings behaves exactly as before).
- You have: the SMTP host and port, the account (username, password) that may send as the chosen sender address, the public https address of the site (no path).
## Steps
1. Open the host's environment file (Pi: `~/apps/<site>/<env>/shared/env`, mode 600).
2. Add, in one go (the order inside the file does not matter, but set `App__PublicBaseUrl` together with the host or the host starts with mail off):
- `App__PublicBaseUrl=https://<site address>`
- `Email__Smtp__Host=<smtp host>`, `Email__Smtp__Port=587`, `Email__Smtp__EnableSsl=true`
- `Email__Smtp__Username=<account>`, `Email__Smtp__Password=<password>`
- ASF: `Email__FromAddress=no-reply@andreaslop.nl`, `Email__AllowedFromAddresses__0=no-reply@andreaslop.nl`, `Email__FromName=Andrea Slop Fotografie` (SlpSoftware: nothing more is needed)
3. Restart the unit (Pi: `systemctl --user restart <unit>`).
4. Read the journal (Pi: `journalctl --user -u <unit> -n 50`):
- success: a line `mail_status enabled=true smtp_host=... starttls=true default_from_domain=...`;
- a line `mail_configuration_invalid ... <setting names>` (Error): mail stays OFF, the site runs; fix the named settings and restart.
5. `curl https://<site>/api/v1/System/capabilities` shows `"emailEnabled":true`.
6. Real test (Bryan): in the admin invite a mailbox of yours (Gmail and Outlook, see the readiness checklist); the dialog says "mail sent" or names the reason. Also try "Wachtwoord vergeten?" on the login page.
7. If a mail is refused, the journal line `identity_mail_failed code=... detail=... phase=... timings=...` tells what happened (`rejected_sender`: the account may not send as that address; `auth_failed`: wrong credentials; `tls_failed`: STARTTLS problem; `timeout_*`: slow or blocked server). Settings to change: see the infrastructure design.
## Changing or removing mail later
Edit the same file and restart. To switch mail off: delete `Email__Smtp__Host` (the copy-link flow keeps working) and restart.