fix(mail-gateway): Brevo verified sender + DNS 409 idempotency#18
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BREVO_FROM_EMAIL=server@lv3.org(a verified Brevo sender) instead of the per-profile address. Profilesender_emailbecomes Reply-To so replies still reach the right mailbox.hetzner_dns_recordsrole 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— addBREVO_FROM_EMAIL/BREVO_FROM_NAMEenv vars; use them insend_via_brevo()mail_platform_runtime/templates/mail-gateway.env.ctmpl.j2+.env.j2— inject the new varsmail_platform_runtime/defaults/main.yml— defaultmail_platform_brevo_sender_emailtoserver@lv3.orghetzner_dns_records/tasks/record.yml— accept 409 in Create task status_code and until/failed_whenTest plan
make converge-mail-platform env=productioncompletes without error/sendwithforce_fallback: truedelivers via Brevo fromserver@lv3.orgdeliverednoterror🤖 Generated with Claude Code