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

Open
#269 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by tracing how Bichon stores archived message index entries and blobs, then follow the account configuration and web UI paths mentioned by the feature request. Check how deletion is currently handled and how account settings are exposed. Done means per-folder policies and a per-account fallback can be configured, and expired messages are removed from the local index and blob store without affecting the IMAP server.

Written by the indexing model from the issue text.

Description

enhancement

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.

Dominant language
Rust
Stars
2.1k
Forks
91
Avg merge
14h 54m
Merged PRs (30d)
6

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rustmailer/bichon

All issues in rustmailer/bichon

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.