linagora / tmail-backend

GNU Affero General Public License v3.0
41 stars 22 forks source link

Deleted Message vault: disable user to restore too old messages #1201

Closed chibenwa closed 1 week ago

chibenwa commented 1 month ago

Why?

While restauring messages as a user is great

I feel uneasy with the current implementation (maximum 5 message restaured).

I can quickly script this to get all the deleted messages thus defeating the deletion.

What?

We can simply say After deleting a message a user have 2 weeks (configurable) to restore an and can restore max 5 messages at a time.

Have a configuration option in deletedMessageVault.properties :

user.restauration.period=15d 

How?

JMAP frontend alter the deletion date filter: after or equal to the 15 day orizon

Definition of done

chibenwa commented 3 weeks ago

Cc @florentos17

As done for https://github.com/linagora/tmail-backend/blob/master/docs/modules/ROOT/pages/tmail-backend/jmap-extensions/deletedMessagesVault.adoc we would need to advertize in the JMAP session the restoration horizon.

maxRestaurationHorizon: String | null, defaulting to 15 days. Horizon past which users can no longer recover emails alone.

Why? It enables the frontend to present the limits to the user and enforce it in user input.

Of course we shall read it from the configuration.

Related people: @hoangdat