Freeze a deleted-but-kept account's archived mail under a legal hold #377

Merged
jcoffey-dev merged 1 commits from fix/legal-hold-deleted-account into main 2026-11-11 18:52:21 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 27e6b0a57b Freeze a deleted-but-kept account's archived mail under a legal hold
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 9m8s
settle_archive's item loop collapsed any gone account to keeping=None, so
an archived item belonging to an account that was deleted while undelete
still retains it kept its finite deadline no matter what holds covered it.
The second loop froze the account's own kept_until but never the item
deadlines, so the scheduled purge destroyed individually-deleted messages
of a departed custodian while a hold was asserting over them (LH-8, LH-6).

A gone-but-kept account now resolves its Keeping from the holds covering
the domain and tenant its kept record carries, so its archived items
freeze and release on the same path a live account's do. A gone-and-not-
kept account still gets None (release only).

Covered by legal_hold_tests: a late, domain-scoped hold over a deleted
custodian now freezes the message they had deleted before leaving.
2026-11-11 11:35:38 -07:00