Deleting a domain with automatic DKIM is refused, and a kept account's destroy task says recovery isn't supported #313

Closed
opened 2026-11-08 06:32:32 +00:00 by jcoffey-dev · 1 comment
Owner

Reported on the forum (https://community.coffeylabs.org/t/232) by someone with account retention set to 30 days, who deleted an account and then couldn't reuse its name.

Two server bugs came out of it:

1. Cancelling a kept account's destroy task points the wrong way. x:Task/set destroy on a DestroyAccount task always fails with "Account recovery is not supported in this deployment" (crates/jmap/src/registry/mapping/task.rs, the destroy loop). That text is left over from upstream. inbuxa does support recovery, through inbuxa:DeletedAccount/set (crates/jmap/src/inbuxa/deleted_account.rs: restore + password, or destroy for good). Refusing the task destroy is right, since the task has to stay paired with the kept record, but the message should send people to inbuxa:DeletedAccount. Rescheduling the task earlier is also refused in effect (it defers itself until kept_until, crates/services/src/task_manager/destroy_account.rs). That part is intended.

2. A domain with automatic DKIM can't be deleted. The DKIM signatures it generated reference it, so RegistryWrite::Delete returns CannotDeleteLinked and the domain stays until someone finds and deletes the keys by hand. Keys made by automatic DKIM management belong to the domain and should go with it. Also, map_write_error builds objectIsLinked with no description, so clients that show only the description show nothing.

Fix:

  • Point the DestroyAccount refusal at inbuxa:DeletedAccount.
  • On x:Domain/set destroy, when the only links left are the domain's own DKIM signatures, delete those first, then the domain. Anything else that's linked (accounts, lists, manual keys on another domain...) still refuses, so nothing is lost if the domain delete would fail anyway.
  • Give objectIsLinked a description that names what's in the way (counts by type).
  • Tests for both.

The console part (a Deleted Accounts page) is a separate issue in inbuxa-admin.

Reported on the forum (https://community.coffeylabs.org/t/232) by someone with account retention set to 30 days, who deleted an account and then couldn't reuse its name. Two server bugs came out of it: **1. Cancelling a kept account's destroy task points the wrong way.** `x:Task/set` destroy on a `DestroyAccount` task always fails with "Account recovery is not supported in this deployment" (`crates/jmap/src/registry/mapping/task.rs`, the destroy loop). That text is left over from upstream. inbuxa does support recovery, through `inbuxa:DeletedAccount/set` (`crates/jmap/src/inbuxa/deleted_account.rs`: `restore` + `password`, or destroy for good). Refusing the task destroy is right, since the task has to stay paired with the kept record, but the message should send people to `inbuxa:DeletedAccount`. Rescheduling the task earlier is also refused in effect (it defers itself until `kept_until`, `crates/services/src/task_manager/destroy_account.rs`). That part is intended. **2. A domain with automatic DKIM can't be deleted.** The DKIM signatures it generated reference it, so `RegistryWrite::Delete` returns `CannotDeleteLinked` and the domain stays until someone finds and deletes the keys by hand. Keys made by automatic DKIM management belong to the domain and should go with it. Also, `map_write_error` builds `objectIsLinked` with no description, so clients that show only the description show nothing. Fix: - Point the `DestroyAccount` refusal at `inbuxa:DeletedAccount`. - On `x:Domain/set` destroy, when the only links left are the domain's own DKIM signatures, delete those first, then the domain. Anything else that's linked (accounts, lists, manual keys on another domain...) still refuses, so nothing is lost if the domain delete would fail anyway. - Give `objectIsLinked` a description that names what's in the way (counts by type). - Tests for both. The console part (a Deleted Accounts page) is a separate issue in inbuxa-admin.
jcoffey-dev added the bug
priority
p1
labels 2026-11-08 06:32:32 +00:00
jcoffey-dev self-assigned this 2026-11-08 06:32:32 +00:00
Author
Owner

Fixed in #314. Deleting a domain now takes its own DKIM keys with it when nothing else uses the domain, "still in use" errors say what is in the way, and the destroy-task refusal points to inbuxa:DeletedAccount/set. It goes out in the next rc. The console page is inbuxa/inbuxa-admin#172.

Fixed in #314. Deleting a domain now takes its own DKIM keys with it when nothing else uses the domain, "still in use" errors say what is in the way, and the destroy-task refusal points to inbuxa:DeletedAccount/set. It goes out in the next rc. The console page is inbuxa/inbuxa-admin#172.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#313