Skip to content

fix(mail-gateway): Brevo verified sender + DNS 409 idempotency#18

Merged
baditaflorin merged 1 commit into
mainfrom
claude/brevo-gateway-fix
May 27, 2026
Merged

fix(mail-gateway): Brevo verified sender + DNS 409 idempotency#18
baditaflorin merged 1 commit into
mainfrom
claude/brevo-gateway-fix

Conversation

@baditaflorin
Copy link
Copy Markdown
Owner

Summary

  • Gateway Brevo fallback now uses BREVO_FROM_EMAIL=server@lv3.org (a verified Brevo sender) instead of the per-profile address. Profile sender_email becomes Reply-To so replies still reach the right mailbox.
  • hetzner_dns_records role treats HTTP 409 as "already present, no change" instead of a hard failure — fixes converge aborts when DNS records exist.

Changes

  • mail_platform_runtime/files/mail-gateway/app.py — add BREVO_FROM_EMAIL/BREVO_FROM_NAME env vars; use them in send_via_brevo()
  • mail_platform_runtime/templates/mail-gateway.env.ctmpl.j2 + .env.j2 — inject the new vars
  • mail_platform_runtime/defaults/main.yml — default mail_platform_brevo_sender_email to server@lv3.org
  • hetzner_dns_records/tasks/record.yml — accept 409 in Create task status_code and until/failed_when

Test plan

  • make converge-mail-platform env=production completes without error
  • Gateway /send with force_fallback: true delivers via Brevo from server@lv3.org
  • Brevo events show delivered not error

🤖 Generated with Claude Code

…tency

- Add BREVO_FROM_EMAIL / BREVO_FROM_NAME env vars so the gateway uses a
  verified Brevo sender address instead of the per-profile address (which
  is not registered in Brevo). Profile sender_email becomes Reply-To so
  replies still land in the correct mailbox.
- Default mail_platform_brevo_sender_email to server@lv3.org (verified).
- Inject BREVO_FROM_EMAIL and BREVO_FROM_NAME in both env templates
  (mail-gateway.env.j2 and mail-gateway.env.ctmpl.j2).
- hetzner_dns_records: treat HTTP 409 Conflict as "record already exists"
  (no change needed) rather than a hard failure. Prevents converge aborts
  when DNS records are already present in the zone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@baditaflorin baditaflorin merged commit dcccfa2 into main May 27, 2026
0 of 2 checks passed
@baditaflorin baditaflorin deleted the claude/brevo-gateway-fix branch May 27, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant