Commit d46803e
fix(mail): route all outbound mail through local Stalwart SMTP; add DKIM and DNS records (#17)
* [live-apply] Woodpecker CI deployed — 0.179.47
Bump platform_version and repo_version to 0.179.47.
Update woodpecker live-apply receipt to reflect successful deployment of
Woodpecker CI (ci.0mpc.com) with OpenBao secret injection, Gitea OAuth
bootstrap, and seed repository activation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [live-apply] DNS ledger and platform-service-watchdog deployed — 2026-05-26
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(mail-gateway): use per-profile SMTP credentials for local Stalwart delivery
The gateway's send_via_local_smtp was authenticating with a global
LOCAL_SMTP_USERNAME/PASSWORD env var, but Stalwart's must-match-sender
enforces that the authenticated user matches the FROM address. With three
profiles each sending from their own mailbox (alerts@, platform@, agents@)
this caused all local SMTP attempts to fail and fall through silently to Brevo.
Changes:
- app.py: load mailbox_password per profile in load_notification_profiles()
- app.py: use profile.mailbox_localpart + profile.mailbox_password as SMTP
credentials in send_via_local_smtp; fall back to global env vars if absent
- app.py: disable SSL cert verification for local Stalwart (self-signed cert)
- defaults/main.yml: flip gateway defaults to attempt_local_first=true,
force_brevo_fallback=false (local SMTP is now the primary path)
- defaults/main.yml: add mail_platform_dkim_* variables for DKIM key management
- stalwart-config.toml.j2: add conditional DKIM signing block
- tasks/main.yml: add task to deploy DKIM private key before Stalwart config render
All three profiles (operator-alerts, platform-transactional, agent-reports) now
route through local Stalwart SMTP and return channel=local_smtp on success.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(mail-dns): switch from Brevo to local Stalwart DKIM; retire Brevo DNS records
- inventory/host_vars/proxmox-host.yml: replace Brevo-specific DNS records with
local DKIM (mail._domainkey TXT), fix SPF to "v=spf1 mx ~all" (remove Brevo
include), mark brevo1/brevo2 CNAME and brevo-code TXT as absent for cleanup
- defaults/main.yml: add mail_platform_dkim_public_key variable (reads from
.local/mail-platform/dkim-public-key.txt at runtime)
Running make converge-mail-platform now sets all mail DNS records for
deliverability without Brevo dependency. The bootstrap playbook
(playbooks/mail-platform.yml) handles the full DNS + runtime converge.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(mail-dns): add dkim_dns_value variable with proper 255-char chunking
DNS TXT records are limited to 255 chars per string. The DKIM public key
(392 chars) plus the prefix (18 chars) totals 410 chars. Add
mail_platform_dkim_dns_value in role defaults that splits the value into
two quoted strings per DNS convention: "v=DKIM1; k=rsa; p=<chunk1>" "<chunk2>"
Use mail_platform_dkim_dns_value in the inventory mail._domainkey record
so make converge-mail-platform is idempotent on future runs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b7e16b5 commit d46803e
5 files changed
Lines changed: 60 additions & 5 deletions
File tree
- collections/ansible_collections/lv3/platform/roles/mail_platform_runtime
- defaults
- files/mail-gateway
- tasks
- templates
- inventory/host_vars
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
68 | 82 | | |
69 | 83 | | |
70 | 84 | | |
| |||
collections/ansible_collections/lv3/platform/roles/mail_platform_runtime/files/mail-gateway/app.py
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
| 378 | + | |
| 379 | + | |
376 | 380 | | |
377 | 381 | | |
378 | | - | |
379 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
380 | 386 | | |
381 | 387 | | |
382 | 388 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
386 | 396 | | |
387 | 397 | | |
388 | 398 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1973 | 1973 | | |
1974 | 1974 | | |
1975 | 1975 | | |
1976 | | - | |
| 1976 | + | |
1977 | 1977 | | |
1978 | 1978 | | |
1979 | 1979 | | |
1980 | 1980 | | |
1981 | 1981 | | |
1982 | 1982 | | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
1983 | 1991 | | |
1984 | 1992 | | |
1985 | 1993 | | |
1986 | 1994 | | |
1987 | 1995 | | |
| 1996 | + | |
1988 | 1997 | | |
1989 | 1998 | | |
1990 | 1999 | | |
1991 | 2000 | | |
1992 | 2001 | | |
| 2002 | + | |
1993 | 2003 | | |
1994 | 2004 | | |
1995 | 2005 | | |
1996 | 2006 | | |
1997 | 2007 | | |
| 2008 | + | |
1998 | 2009 | | |
1999 | 2010 | | |
2000 | 2011 | | |
| |||
0 commit comments