Automatic DNS: changes to publishRecords do not schedule DNS reconciliation #372

Closed
opened 2026-11-11 11:40:21 +00:00 by StefanSa · 2 comments

Problem

When a domain already uses Automatic DNS management, changing the selected publishRecords is saved successfully but does not schedule a DNS provisioning/reconciliation task.

Example:

before:
dkim, spf, mx

after:
dkim, spf, mx, dmarc

The updated domain configuration is persisted, but no DNS task is created and the newly enabled record family is therefore not published to the configured DNS provider.

This is different from:

  • creating a new automatically managed domain
  • switching a domain from Manual to Automatic DNS

Both of those paths already schedule DNS provisioning.

Root cause

The domain update path does not currently treat changes to publishRecords as a DNS provisioning trigger while the DNS mode remains Automatic.

The existing DKIM-specific handling is preserved, but there is no general trigger for newly enabled record families.

Proposed fix

When:

DNS mode before = Automatic
DNS mode after  = Automatic

and one or more record families have been newly enabled in publishRecords, schedule one DNS task containing those newly enabled families.

The patch intentionally does not add deletion semantics.

Existing behaviour is preserved:

  • unchanged publishRecords → no new task
  • reordered but otherwise identical sets → no new task
  • Manual mode → no Automatic DNS task
  • Manual → Automatic → existing provisioning path remains unchanged
  • DKIM-specific behaviour remains unchanged
  • ACME handoff remains unchanged

Important existing behaviour

Removing a record type from publishRecords does not delete records that were previously published.

The current DNS execution path only publishes the records present in the task and does not implement general pruning of previously managed DNS records.

This patch therefore only addresses newly enabled record families and does not introduce automatic DNS deletion.

Validation

The patch was validated with:

  • 9 focused tests
  • JMAP compile PASS
  • rustfmt PASS
  • Clippy PASS
  • no Clippy findings in the changed source file

Diff:

1 source file
+225 / -49

No production rollout or DNS write was performed.

I have a tested patch ready and can attach it to this ticket.

### Problem When a domain already uses **Automatic DNS management**, changing the selected `publishRecords` is saved successfully but does not schedule a DNS provisioning/reconciliation task. Example: ```text before: dkim, spf, mx after: dkim, spf, mx, dmarc ``` The updated domain configuration is persisted, but no DNS task is created and the newly enabled record family is therefore not published to the configured DNS provider. This is different from: - creating a new automatically managed domain - switching a domain from Manual to Automatic DNS Both of those paths already schedule DNS provisioning. ### Root cause The domain update path does not currently treat changes to `publishRecords` as a DNS provisioning trigger while the DNS mode remains Automatic. The existing DKIM-specific handling is preserved, but there is no general trigger for newly enabled record families. ### Proposed fix When: ```text DNS mode before = Automatic DNS mode after = Automatic ``` and one or more record families have been newly enabled in `publishRecords`, schedule one DNS task containing those newly enabled families. The patch intentionally does not add deletion semantics. Existing behaviour is preserved: - unchanged `publishRecords` → no new task - reordered but otherwise identical sets → no new task - Manual mode → no Automatic DNS task - Manual → Automatic → existing provisioning path remains unchanged - DKIM-specific behaviour remains unchanged - ACME handoff remains unchanged ### Important existing behaviour Removing a record type from `publishRecords` does not delete records that were previously published. The current DNS execution path only publishes the records present in the task and does not implement general pruning of previously managed DNS records. This patch therefore only addresses **newly enabled record families** and does not introduce automatic DNS deletion. ### Validation The patch was validated with: - 9 focused tests - JMAP compile PASS - rustfmt PASS - Clippy PASS - no Clippy findings in the changed source file Diff: ```text 1 source file +225 / -49 ``` No production rollout or DNS write was performed. I have a tested patch ready and can attach it to this ticket.
jcoffey-dev added the bug
priority
p2
labels 2026-11-11 18:20:16 +00:00
Owner

Thanks @StefanSa, that's a real one. We've been working around it by switching a domain to Manual and back to Automatic. Yes please, attach the git format-patch here like you did on #296 and I'll review it.

Thanks @StefanSa, that's a real one. We've been working around it by switching a domain to Manual and back to Automatic. Yes please, attach the `git format-patch` here like you did on #296 and I'll review it.
jcoffey-dev self-assigned this 2026-11-11 19:44:50 +00:00
Owner

Thanks @StefanSa, merged with you as the author: #389 for 27.1 and #390 for 2026.x. With DNS already Automatic, adding a record type to publishRecords now publishes just the new types. Removing one still deletes nothing, as you designed it.

The 2026.x one is your patch as attached. Main had moved on since, so #389 is a small port: it keeps an existing guard (#304), so a domain with nothing to publish and no certificate to order still queues no DNS task. Your tests are in both, and the full automation suite passed against it.

It'll be in the next 27.1 RC and the next 2026.x release.

Thanks @StefanSa, merged with you as the author: #389 for 27.1 and #390 for 2026.x. With DNS already Automatic, adding a record type to `publishRecords` now publishes just the new types. Removing one still deletes nothing, as you designed it. The 2026.x one is your patch as attached. Main had moved on since, so #389 is a small port: it keeps an existing guard (#304), so a domain with nothing to publish and no certificate to order still queues no DNS task. Your tests are in both, and the full automation suite passed against it. It'll be in the next 27.1 RC and the next 2026.x release.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#372