Skip to content

feat: persist special-use folder mapping and detect on the backend - #63

Merged
LeiCraft merged 3 commits into
mainfrom
feature/folder-management
Jul 6, 2026
Merged

feat: persist special-use folder mapping and detect on the backend#63
LeiCraft merged 3 commits into
mainfrom
feature/folder-management

Conversation

@Bensonheimer992

Copy link
Copy Markdown
Collaborator

Adds a per-account special-use folder mapping (drafts/sent/spam/trash/ archive) that the backend detects once (IMAP \Flag -> multilingual name heuristic), stores in a new mail_account_special_use table, and reuses so neither it nor the client re-guesses on every request. Users can override individual mappings; overrides survive re-detection while their folder exists. Mailbox listings now return the resolved specialUse, and the mapping is re-detected after folder create/rename/delete and dropped on account delete. Exposes GET/PUT /mail-accounts/:id/special-use.

Adds a per-account special-use folder mapping (drafts/sent/spam/trash/
archive) that the backend detects once (IMAP \Flag -> multilingual name
heuristic), stores in a new mail_account_special_use table, and reuses so
neither it nor the client re-guesses on every request. Users can override
individual mappings; overrides survive re-detection while their folder
exists. Mailbox listings now return the resolved specialUse, and the
mapping is re-detected after folder create/rename/delete and dropped on
account delete. Exposes GET/PUT /mail-accounts/:id/special-use.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Bensonheimer992
Bensonheimer992 requested review from a team and Copilot July 6, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Bensonheimer992 and others added 2 commits July 6, 2026 20:49
Unit tests for the pure detection logic (flag-first/name-heuristic
detectType, reconcile preserving valid user overrides, apply normalizing
and clearing stray flags) plus route tests against the mock IMAP server:
GET auto-detects and persists, PUT overrides and reverts, listing reflects
overrides, invalid paths 400, and unauthenticated access 401.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LeiCraft
LeiCraft merged commit e47482d into main Jul 6, 2026
1 check passed
@LeiCraft
LeiCraft deleted the feature/folder-management branch July 6, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants