Add mail profile folder mapping for standard IMAP folders #15

Closed
opened 2026-07-14 17:45:09 +02:00 by zemion · 2 comments
Owner

Context

IMAP append was moved out of generic server settings and is now a campaign delivery setting. The old shared server settings UI also exposed a single Sent folder value, but the more durable design is profile/server-level folder mapping for standard IMAP folders.

Scope

Add mail-profile folder mapping in govoplan-mail for standard folders such as Inbox, Sent, Drafts, Trash, Archive, and Junk.

  • Persist mappings per mail profile/server configuration.
  • Reuse the existing IMAP folder listing/detection endpoints where possible.
  • Migrate or round-trip the existing imap.sent_folder value as the Sent mapping.
  • Let campaign IMAP append keep its campaign override, while being able to default from the selected profile mapping later.
  • Keep campaign consumption behind core/mail capabilities rather than direct module-to-module UI imports.

Acceptance Criteria

  • Mail profile settings can save and display standard folder mappings.
  • Existing profiles with imap.sent_folder keep their effective Sent folder.
  • Folder lookup can populate a detected Sent folder and expose available folders for mapping.
  • Campaign append behavior remains backward compatible with the stored campaign override.
  • Backend and WebUI tests cover save/load, migration or compatibility, and the profile editor model.
## Context IMAP append was moved out of generic server settings and is now a campaign delivery setting. The old shared server settings UI also exposed a single Sent folder value, but the more durable design is profile/server-level folder mapping for standard IMAP folders. ## Scope Add mail-profile folder mapping in `govoplan-mail` for standard folders such as Inbox, Sent, Drafts, Trash, Archive, and Junk. - Persist mappings per mail profile/server configuration. - Reuse the existing IMAP folder listing/detection endpoints where possible. - Migrate or round-trip the existing `imap.sent_folder` value as the Sent mapping. - Let campaign IMAP append keep its campaign override, while being able to default from the selected profile mapping later. - Keep campaign consumption behind core/mail capabilities rather than direct module-to-module UI imports. ## Acceptance Criteria - Mail profile settings can save and display standard folder mappings. - Existing profiles with `imap.sent_folder` keep their effective Sent folder. - Folder lookup can populate a detected Sent folder and expose available folders for mapping. - Campaign append behavior remains backward compatible with the stored campaign override. - Backend and WebUI tests cover save/load, migration or compatibility, and the profile editor model.
Author
Owner

Drift note, 2026-07-20: the shared dirty workspace contains an uncommitted fix for quoting IMAP mailbox names. Preserve or isolate that fix when implementing folder mapping, with focused tests for spaces, delimiters, non-ASCII names, and provider-specific quoting.

Drift note, 2026-07-20: the shared dirty workspace contains an uncommitted fix for quoting IMAP mailbox names. Preserve or isolate that fix when implementing folder mapping, with focused tests for spaces, delimiters, non-ASCII names, and provider-specific quoting.
zemion added the area/apicodex/readymodule/mail
priority
p2
status
ready
type
feature
labels 2026-07-29 14:15:06 +02:00
Author
Owner

Implemented and published.

  • Core 9d1352b defines the typed standard-folder mapping contract and shared profile editor for Inbox, Sent, Drafts, Trash, Archive, and Junk.
  • Mail e0e00d7 persists mappings in the existing profile transport JSON, discovers roles from IMAP SPECIAL-USE flags with bounded German/English name fallbacks, applies discovered mappings in the profile UI, and opens the configured Inbox by default.
  • Legacy imap.sent_folder values round-trip into the Sent mapping and remain synchronized, so existing Campaign Sent-folder overrides retain their precedence and compatibility.
  • No database migration is required.
  • Documentation now covers discovery, manual correction, legacy behavior, and operational consequences.

Verification: 127 Mail tests; 74 focused Core config/API tests; Core and Mail WebUI suites and production builds; Ruff; manifest and contract checks; full workspace focused gate including 57 WebUI module permutations, bundle budgets, and 7 Playwright conformance tests.

Implemented and published. - Core `9d1352b` defines the typed standard-folder mapping contract and shared profile editor for Inbox, Sent, Drafts, Trash, Archive, and Junk. - Mail `e0e00d7` persists mappings in the existing profile transport JSON, discovers roles from IMAP SPECIAL-USE flags with bounded German/English name fallbacks, applies discovered mappings in the profile UI, and opens the configured Inbox by default. - Legacy `imap.sent_folder` values round-trip into the Sent mapping and remain synchronized, so existing Campaign Sent-folder overrides retain their precedence and compatibility. - No database migration is required. - Documentation now covers discovery, manual correction, legacy behavior, and operational consequences. Verification: 127 Mail tests; 74 focused Core config/API tests; Core and Mail WebUI suites and production builds; Ruff; manifest and contract checks; full workspace focused gate including 57 WebUI module permutations, bundle budgets, and 7 Playwright conformance tests.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-mail#15