bichon icon indicating copy to clipboard operation
bichon copied to clipboard

**Feature Request: Configurable retention policies with per-folder age-based deletion**

Open chc-pr opened this issue 6 months ago • 4 comments

Describe the feature

Bichon currently retains all archived emails indefinitely with no mechanism to automatically delete emails from the archive based on age. A retention policy system would allow users to configure automatic deletion of archived emails older than a specified period, ideally configurable at the folder level rather than just globally per account.

Proposed behaviour

  • Allow a retention period to be configured per folder (e.g. delete archived emails from INBOX.Junk after 30 days, INBOX.Sent after 365 days, INBOX after 7 years)
  • Also support a global per-account fallback retention period for folders without a specific policy
  • Retention deletion should apply only to the local Bichon archive — it should never delete anything from the IMAP server (in keeping with Bichon's existing non-destructive philosophy)
  • Deletion should remove both the index entry and the blob store entry for the affected email
  • Retention policies should be configurable per account via the web UI

Why this matters

Without retention management, the archive grows indefinitely. For users archiving multiple accounts over years, this becomes a significant and unmanageable disk space issue. Folders like Junk, Trash, and promotional email subfolders in particular accumulate large volumes of low-value mail that does not need to be retained long-term.

Per-folder granularity is important because different folders have very different retention requirements — a user may want to keep Inbox emails for several years but purge Junk after 30 days.

Additional context

This feature exists in commercial email archivers such as Mailstore and in Mail-Archiver (s1t5/mail-archiver), where it is one of the primary reasons users choose a more feature-complete archiver. Its absence is currently a barrier to Bichon being used as a full Mailstore replacement.

chc-pr avatar May 24 '26 16:05 chc-pr

Thanks, noted! Will add this to the roadmap. Appreciate the detailed writeup! 🙏

rustmailer avatar May 25 '26 01:05 rustmailer

I think the thanks goes to you. Really nice project. Happy to test any pre-release copies if that helps you.

chc-pr avatar May 25 '26 09:05 chc-pr

Sorry, the deletion policy for each mail folder has not been implemented. Version 2.1.0 implemented the deletion policy for the mail account as a whole.

rustmailer avatar Oct 07 '26 08:10 rustmailer

I think a more granular retention policy would be great, not only by age/folder but also by more advanced filters like sender, subject, with or without attachments... Being able to define rules that run on a schedule and deletes emails that matches defined conditions would be awesome!

maid450 avatar Oct 07 '26 12:10 maid450