From 9a73cc78d6160f8a07ebbf893b5ac91cda7d913a Mon Sep 17 00:00:00 2001 From: Peter van Arkel Date: Sun, 22 Nov 2026 11:05:15 +0100 Subject: [PATCH] Retain routing state until retirement publishes safely --- src/coulobre/mail_node_routing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coulobre/mail_node_routing.py b/src/coulobre/mail_node_routing.py index 9c3eb02..031e795 100644 --- a/src/coulobre/mail_node_routing.py +++ b/src/coulobre/mail_node_routing.py @@ -146,6 +146,7 @@ def reconcile_routes(records, *, retired=None): return previous = read_table() recipients = managed_recipients(records) + pruned = None if retired is not None and retired.domain in routes: spec = routes[retired.domain] if any( @@ -166,6 +167,7 @@ def reconcile_routes(records, *, retired=None): spec = MailRouting(spec.domain, aliases, catchall) else: spec = MailRouting(spec.domain, {}) - routes[spec.domain] = spec - save_policy(spec) + routes[spec.domain] = pruned = spec publish_routes(routes, recipients, previous) + if pruned is not None: + save_policy(pruned)