Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Add option to Control Message Retention by Age (TTL) #338

Closed
alexkved opened this issue Jul 30, 2024 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@alexkved
Copy link

Description
Currently, Mailpit allows users to limit the maximum number of email messages stored using the MP_MAX_MESSAGES option. However, some users would prefer to control the retention of messages based on their age. For example, automatically deleting messages older than a specified number of hours or days.

Proposed Solution
Introduce a new option MP_MAX_MESSAGE_AGE that specifies the maximum age of messages to be retained in Mailpit. Messages older than this age should be automatically deleted.

Option:
MP_MAX_MESSAGE_AGE: Specifies the maximum age of messages in hours or days. For example, 72h to retain messages for 72 hours or 3d for 3 days.

Benefits

  • Provides more flexible message retention policies based on message age.
  • Helps manage storage by automatically cleaning up older messages.
  • Ensures compliance with policies requiring the deletion of older messages.

Example Usage:

docker run -d \
  -e MP_MAX_MESSAGE_AGE=72h \
  -p 8025:8025 \
  axllent/mailpit
@axllent
Copy link
Owner

axllent commented Jul 30, 2024

Thanks for your suggestion @alexkved, this makes sense to me. I do not have an ETA as I'm working on another big task right now, but I'll add this to my "TODO" list 👍

@axllent axllent added the enhancement New feature or request label Jul 30, 2024
@alexkved
Copy link
Author

Thank you for considering this feature request. We appreciate your time and effort in reviewing it, and we look forward to any updates you might have on this in the future.

@axllent
Copy link
Owner

axllent commented Aug 6, 2024

This feature has been released in v1.20.0. Please see the release notes and linked documentation, and let me know if this works for you? Thanks.

@alexkved
Copy link
Author

alexkved commented Aug 7, 2024

@axllent , thank you very much for your effort. It works like a charme.

@axllent
Copy link
Owner

axllent commented Aug 7, 2024

That's great to hear, thanks for the feedback!

@axllent axllent closed this as completed Aug 7, 2024
tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue Aug 10, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [axllent/mailpit](https://github.com/axllent/mailpit) | minor | `v1.19.3` -> `v1.20.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>axllent/mailpit (axllent/mailpit)</summary>

### [`v1.20.1`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1201)

[Compare Source](axllent/mailpit@v1.20.0...v1.20.1)

##### Chore

-   Shift inbox pagination to inbox component
-   Live load up to 100 new messages in sidebar ([#&#8203;336](axllent/mailpit#336))
-   Show icon attachment in new side navigation message listing ([#&#8203;345](axllent/mailpit#345))

##### Fix

-   Correctly decode X-Tags message headers (RFC 2047) ([#&#8203;344](axllent/mailpit#344))

### [`v1.20.0`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1200)

[Compare Source](axllent/mailpit@v1.19.3...v1.20.0)

##### Feature

-   Add option to control message retention by age ([#&#8203;338](axllent/mailpit#338))
-   **UI:** List messages in side nav when viewing message for easy navigation ([#&#8203;336](axllent/mailpit#336))

##### Chore

-   Update caniemail database
-   Update Go dependencies
-   Update node dependencies
-   Make internal tagging methods private

##### Fix

-   Prevent potential JavaScript errors caused by race condition
-   Better regexp to detect tags in search
-   Prevent Vue race condition to initialize dayjs relativeTime plugin
-   **API:** Return `text/plain` header for message delete request

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants