mail: consolidate SPF, move MX to Forward Email, add a real sender #13

Merged
founder merged 1 commit from mail-forwardemail-dns-and-sender into main 2026-07-26 11:05:37 +00:00
Owner

Fixes a live deliverability bug and completes the move of inbound mail to Forward Email.

  • SPF: the apex published two SPF records. That is a permerror under RFC 7208, so receivers could treat all key.store mail as unauthenticated. Collapsed to one record and dropped mailgun (unused).
  • MX: Forward Email requires both of its hosts and refuses to verify while any other MX exists. The script upserted a single mx.key.store at priority 10, which violated that and would silently re-add the record after removal. Now declarative, with pruning of unmanaged MX records.
  • Sender: adds Scripts/send-mail.py so agents have a supported send path. Credentials come from the agenix secret, never argv.

Stalwart stays the submission endpoint and already relayed outbound through Forward Email, so identity is unchanged.

Verified: probes delivered to INBOX (not spam), services/mail/delivery-smoke.py passes against the new MX set, both scripts syntax-clean, prune dry-run shows convergence.

🤖 Generated with Claude Code

Fixes a live deliverability bug and completes the move of inbound mail to Forward Email. - **SPF**: the apex published *two* SPF records. That is a permerror under RFC 7208, so receivers could treat all key.store mail as unauthenticated. Collapsed to one record and dropped mailgun (unused). - **MX**: Forward Email requires both of its hosts and refuses to verify while any other MX exists. The script upserted a single `mx.key.store` at priority 10, which violated that and would silently re-add the record after removal. Now declarative, with pruning of unmanaged MX records. - **Sender**: adds `Scripts/send-mail.py` so agents have a supported send path. Credentials come from the agenix secret, never argv. Stalwart stays the submission endpoint and already relayed outbound through Forward Email, so identity is unchanged. Verified: probes delivered to INBOX (not spam), `services/mail/delivery-smoke.py` passes against the new MX set, both scripts syntax-clean, prune dry-run shows convergence. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mail: consolidate SPF, move MX to Forward Email, add a real sender
Some checks failed
Release: If Needed / Check (Release Needed) (push) Successful in 5s
Deploy: API / Deploy (API) (push) Has been cancelled
Deploy: Web / Deploy (Web) (push) Has been cancelled
42f8c6c2cc
key.store published two apex SPF records (`v=spf1 mx ~all` and one carrying
mailgun + forwardemail). Two SPF records on one name is a permerror under
RFC 7208, so receivers were entitled to treat every message as unauthenticated
— the record that authorised the real sender was invalidated by the one next to
it. Collapse to a single record and drop mailgun, which we do not send through.

Inbound terminates at Forward Email, which requires both of its MX hosts and
refuses to verify the domain while any other MX exists. The script previously
upserted a single `mx.key.store` at priority 10, which both violated that rule
and would silently re-add the record after an operator removed it. Manage the
Forward Email pair declaratively and prune unmanaged MX records instead.

Stalwart remains the submission endpoint and already relays outbound through
Forward Email (`queue.strategy.route`), so this changes routing, not identity.

Add Scripts/send-mail.py: agents and workflows needing to send real mail now
have a supported path rather than hand-rolling SMTP. Credentials come from the
agenix secret, never the command line. Verified end to end — probes delivered to
INBOX, and services/mail/delivery-smoke.py passes against the new MX set.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/key.store!13
No description provided.