feat(mail): map standard IMAP folders per profile

This commit is contained in:
2026-08-19 21:27:42 +02:00
parent 393331574a
commit e0e00d7000
13 changed files with 243 additions and 33 deletions
+4 -2
View File
@@ -1179,6 +1179,7 @@ def _mailbox_folder_response(
message=f"Found {len(folders)} IMAP folder(s).",
folders=folders,
detected_sent_folder=result.detected_sent_folder,
detected_folder_mappings=getattr(result, "detected_folder_mappings", None) or {},
from_cache=from_cache,
refreshing=refreshing,
indexed_at=indexed_at,
@@ -2276,7 +2277,7 @@ def update_profile(
session,
profile=profile,
protocol="smtp",
config=smtp_config.model_dump(mode="json"),
config=smtp_config.model_dump(mode="json", exclude_none=True),
user_id=principal.user.id,
)
imap_server = None
@@ -2286,7 +2287,7 @@ def update_profile(
profile=profile,
protocol="imap",
config=(
imap_config.model_dump(mode="json")
imap_config.model_dump(mode="json", exclude_none=True)
if imap_config is not None and not payload.clear_imap
else None
),
@@ -3063,6 +3064,7 @@ def list_imap_folder_settings(
message=f"Found {len(folders)} IMAP folder(s).",
folders=folders,
detected_sent_folder=result.detected_sent_folder,
detected_folder_mappings=getattr(result, "detected_folder_mappings", None) or {},
)
except Exception as exc:
return MailImapFolderListResponse(