Mailbox Cleanup: subscriptions view with unsubscribe and per-sender state
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- backend, databases, frontend, full-stack
Research direction
Start by tracing the existing Settings > Mail > Cleanup view and the /mailbox-usage sender grouping, then inspect POST /messages/:id/unsubscribe and its RFC 8058 and fallback behavior. Implement the paged sender query and row states, constrain Delete all to inbox messages with list_unsubscribe, and add the specified backend and frontend tests. Done includes an EXPLAIN ANALYZE for a mailbox with at least 100k messages.
Written by the indexing model from the issue text.
Description
What
Extend Settings > Mail > Cleanup (beta) into a per-account subscriptions view: every sender whose mail carries a List-Unsubscribe header, with an Unsubscribe action and an "unsubscribed on" state, alongside the existing per-sender Archive / Move to Trash.
Users consolidating years of mail across several accounts hold thousands of newsletter and mailing-list messages. Cleanup today shows only the top 25 bulk senders in the inbox, and unsubscribing means opening one message per sender.
Scope
- Sender list. Group by
lower(from_email)(as/mailbox-usagedoes) over messages wherelist_unsubscribeis present, not byis_bulk. Per row: sender name, address, message count, last received date. Paged, so it isn't capped at 25. - Delete all from this sender. Same actions as today: Archive by default (#403), Move to Trash optional, confirmation showing the count. Scope stays inbox messages carrying the header. Some senders put List-Unsubscribe on receipts and account notices, so this must never reach a message without the header or outside the inbox. Widening to other folders is out of scope here.
- Unsubscribe. Calls the existing
POST /messages/:id/unsubscribeon the sender's newest message that has the header, reusing its RFC 8058 one-click path and its private-address and redirect checks. When one-click isn't offered, use the fallback the route already returns (URL or mailto). No bulk "unsubscribe all": requests go out one sender at a time, on the user's action. - Unsubscribed state. No migration: derive it from the newest
unsubscribed_atacross the sender's messages. Show "Unsubscribed on ". Hide the row when no message has arrived after that date; show it again if one does, since that means the unsubscribe didn't take. - Performance. Include
EXPLAIN ANALYZEfor the sender query on a large mailbox (100k+ messages) in the PR.
Not in scope
- New plugin API capabilities (aggregate reads, unsubscribe, delete by sender). These stay in core.
- Folders other than the inbox for Delete all.
Tests
- Backend: the sender query (grouping, counts, last date, unsubscribed state, row hiding), and that Delete all never reaches a message without the header or outside the inbox.
- Frontend: render tests for the row states (subscribed, unsubscribed, unsubscribed with newer mail).
Contributions welcome. Please comment here before starting so the work isn't duplicated.
- Dominant language
- JavaScript
- Stars
- 518
- Forks
- 50
- Avg merge
- 4d 45m
- Merged PRs (30d)
- 43
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from maathimself/mailflow
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
maathimself/mailflow#801 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
maathimself/mailflow#784 ·
Maintainers usually reply within 1 day
-
defaultShortcuts tests fail on macOSPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
maathimself/mailflow#783 ·
Maintainers usually reply within 1 day
-
Stored mail loses blockquote type=cite, so AI actions read Apple Mail and Thunderbird quoted historyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
maathimself/mailflow#782 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
maathimself/mailflow#799 ·
Maintainers usually reply within 1 day
All issues in maathimself/mailflow
Similar issues
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Feyisara2108/stellargive#1378 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blixvip/solana-tx-parse#18 ·