Backports both legal-hold fixes to release/2026 for a 2026.x security release. release/2026 carries the identical buggy code, so the 2026.x line is affected the same as 27.1.
9dae9b04 — cherry-pick of #377 (27e6b0a): a legal hold now freezes the archived mail of an account deleted while undelete still kept it, instead of the scheduled purge destroying it under an active hold.
dcd32909 — cherry-pick of #381 (c884bad): a deleted-but-held account's audit and journal records are kept under the hold (held_accounts() folds in kept accounts a hold covers).
Both cherry-picked clean with -x (original hashes in the commit messages). On 27.1 these shipped in 27.1-rc.21.
Clean room
Both commits worked only against inbuxa's own tree — the hold/undelete/audit hooks in crates/common/crates/services and the existing legal_hold test. No Stalwart Enterprise-licensed source was read.
Testing
Built and ran legal_hold_tests against this release/2026 base — green (the Finding 2 item proven RED without the fix, GREEN with it on main); cargo fmt --check clean. CI does not run the #[ignore]d system suite, so it was checked locally.
Run: RUST_MIN_STACK=16777216 STORE=RocksDb cargo test -p tests legal_hold_tests -- --ignored
Release
Lands right before the 2026.x security release, per the batch route. Both items go in one advisory (spoliation under an active legal hold); advisory publishes once prod runs the patched builds, on John's go-ahead. Merge/timing is John's call.
## What
Backports both legal-hold fixes to `release/2026` for a 2026.x security release. `release/2026` carries the identical buggy code, so the 2026.x line is affected the same as 27.1.
- `9dae9b04` — cherry-pick of #377 (`27e6b0a`): a legal hold now freezes the archived mail of an account deleted while undelete still kept it, instead of the scheduled purge destroying it under an active hold.
- `dcd32909` — cherry-pick of #381 (`c884bad`): a deleted-but-held account's audit and journal records are kept under the hold (`held_accounts()` folds in kept accounts a hold covers).
Both cherry-picked clean with `-x` (original hashes in the commit messages). On 27.1 these shipped in `27.1-rc.21`.
## Clean room
Both commits worked only against inbuxa's own tree — the hold/undelete/audit hooks in `crates/common`/`crates/services` and the existing `legal_hold` test. No Stalwart Enterprise-licensed source was read.
## Testing
Built and ran `legal_hold_tests` against this `release/2026` base — green (the Finding 2 item proven RED without the fix, GREEN with it on main); `cargo fmt --check` clean. CI does not run the `#[ignore]`d system suite, so it was checked locally.
Run: `RUST_MIN_STACK=16777216 STORE=RocksDb cargo test -p tests legal_hold_tests -- --ignored`
## Release
Lands right before the 2026.x security release, per the batch route. Both items go in one advisory (spoliation under an active legal hold); advisory publishes once prod runs the patched builds, on John's go-ahead. Merge/timing is John's call.
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.
(cherry picked from commit 27e6b0a57b)
held_accounts() scanned only live accounts, so an account deleted while
undelete still kept it -- the case a legal hold is placed for -- was absent
from the set the retention purges trust. audit_purge consults it directly,
so a deleted-but-held account's audit trail was purged once past the 90-day
floor while the hold was active. The journal purge augmented the set at its
own call site, so it was affected only when a hold covered no live account.
held_accounts() now folds in the accounts undelete keeps that a hold covers,
through the domain and tenant their retained record carries, so every purge
that trusts it keeps a deleted-but-held account's records. The journal call
site's now-redundant augmentation is removed, leaving one source of truth.
Covered by legal_hold_tests: a deleted-but-held custodian is now present in
held_accounts() (LH-6, AU-7).
(cherry picked from commit c884bad555)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Backports both legal-hold fixes to
release/2026for a 2026.x security release.release/2026carries the identical buggy code, so the 2026.x line is affected the same as 27.1.9dae9b04— cherry-pick of #377 (27e6b0a): a legal hold now freezes the archived mail of an account deleted while undelete still kept it, instead of the scheduled purge destroying it under an active hold.dcd32909— cherry-pick of #381 (c884bad): a deleted-but-held account's audit and journal records are kept under the hold (held_accounts()folds in kept accounts a hold covers).Both cherry-picked clean with
-x(original hashes in the commit messages). On 27.1 these shipped in27.1-rc.21.Clean room
Both commits worked only against inbuxa's own tree — the hold/undelete/audit hooks in
crates/common/crates/servicesand the existinglegal_holdtest. No Stalwart Enterprise-licensed source was read.Testing
Built and ran
legal_hold_testsagainst thisrelease/2026base — green (the Finding 2 item proven RED without the fix, GREEN with it on main);cargo fmt --checkclean. CI does not run the#[ignore]d system suite, so it was checked locally.Run:
RUST_MIN_STACK=16777216 STORE=RocksDb cargo test -p tests legal_hold_tests -- --ignoredRelease
Lands right before the 2026.x security release, per the batch route. Both items go in one advisory (spoliation under an active legal hold); advisory publishes once prod runs the patched builds, on John's go-ahead. Merge/timing is John's call.