|
| 1 | +# 75. Deletes Message Vault |
| 2 | + |
| 3 | +Date: 2025-12-19 |
| 4 | + |
| 5 | +## Status |
| 6 | + |
| 7 | +Accepted (lazy consensus) & implemented. |
| 8 | + |
| 9 | +This ADR is written at posteriori in order to capture knowlege of the team following the write up |
| 10 | +of [0074-dedicated-eventbus-for-message-content-deletion.md](0074-dedicated-eventbus-for-message-content-deletion.md) |
| 11 | + |
| 12 | +## Context |
| 13 | + |
| 14 | +In standard email systems, when a message is deleted—whether by a user, an administrator, or automatically—it is often permanently lost. This creates several |
| 15 | +problems in environments where email is a critical business record. |
| 16 | + |
| 17 | +As such we want a mechanism that protects against: |
| 18 | + |
| 19 | + - **Accidental or malicious deletion**: Users can accidentally delete important emails, or malicious actors may intentionally remove messages to hide evidence. Recovery |
| 20 | +shall be possible. |
| 21 | + - **Legal and regulatory compliance**: Many organizations must comply with regulations that require retention of business communications and the ability to produce |
| 22 | +deleted emails during audits or legal discovery. |
| 23 | + - **Administrator control and traceability**: administrator needs to control and understand destructive actions done on user account (date of deletion and what had been deleted). |
| 24 | + |
| 25 | +However we want a clear **separation of user experience and data retention**. Users expect that “delete” means the message disappears from their mailbox. |
| 26 | + |
| 27 | +However incident recovery, and Recovery Point Objectives are a non objective that shall be addressed through global database level backups. |
| 28 | + |
| 29 | +## Decision |
| 30 | + |
| 31 | +Provide a James mailbox plugin, bundled in Guice application, the **Deleted Message Vault**. |
| 32 | + |
| 33 | +Provide an implementation of this vault atop the object store, which stores data in a time organized fashion (per month) in a dedicated buckets. Minimal |
| 34 | +metadata are to be kept onto the Cassandra / Postgres database. |
| 35 | + |
| 36 | +Provide a webadmin endpoints for restoring user data, with a minimal and simple fliter logic to allow restoring specific content. This action is not exposed to the end user. |
| 37 | + |
| 38 | +Provide a webadmin endpoint to access deleted messages if need be. |
| 39 | + |
| 40 | +Provide a webadmin endpoint to delete the vault data that no longer needs to be retained. |
| 41 | + |
| 42 | +Plug this vault onto the mailbox deletion process. We leverage [0029-Cassandra-mailbox-deletion-cleanup.md](0029-Cassandra-mailbox-deletion-cleanup.md) asynchronous deletion listener as well as |
| 43 | +the [0074-dedicated-eventbus-for-message-content-deletion.md](0074-dedicated-eventbus-for-message-content-deletion.md) dedicated event bus for effective content deletion to do so. Please |
| 44 | +note that blob deduplication mentioned in [0049-deduplicated-blobs-gs-with-bloom-filters.md](0049-deduplicated-blobs-gs-with-bloom-filters.md) needs to be active. |
| 45 | + |
| 46 | +## Consequences |
| 47 | + |
| 48 | +Aforementioned objectives are attained. |
| 49 | + |
| 50 | +An extra copy is needed upon deletes which can be expensive. That is why we needed [0074-dedicated-eventbus-for-message-content-deletion.md](0074-dedicated-eventbus-for-message-content-deletion.md) |
| 51 | +especially upon large mailbox deletion. |
| 52 | + |
| 53 | +Disk space impact: |
| 54 | + - Deleted message vault is not counted onto the user quota |
| 55 | + - Content is not deduplicated onto the deleted message vault |
| 56 | + |
| 57 | +# References |
| 58 | + |
| 59 | + - [0029-Cassandra-mailbox-deletion-cleanup.md](0029-Cassandra-mailbox-deletion-cleanup.md) |
| 60 | + - [0049-deduplicated-blobs-gs-with-bloom-filters.md](0049-deduplicated-blobs-gs-with-bloom-filters.md) |
| 61 | + - [0074-dedicated-eventbus-for-message-content-deletion.md](0074-dedicated-eventbus-for-message-content-deletion.md) |
| 62 | + - [Asynchronous deletions with DeletedMessageVault on top of Cassandra](https://issues.apache.org/jira/browse/JAMES-3882) |
| 63 | + |
0 commit comments