feat: live IMAP sync on folder select + 60s auto-sync interval

- New imap_sync_folder function: syncs single folder quickly for live use
- New POST /mail/folders/{folder_id}/sync route
- Frontend: syncFolder API + called on every folder selection
- Auto-sync interval reduced from 300s to 60s
- Sent mail IMAP APPEND already uploads full body via msg.as_bytes()
This commit is contained in:
Agent Zero
2026-07-20 12:01:16 +02:00
parent c24a86bc90
commit 3313047577
5 changed files with 259 additions and 3 deletions
+4
View File
@@ -481,6 +481,10 @@ export function emptyFolder(folderId: string): Promise<{ emptied_count: number }
return apiPost<{ emptied_count: number }>(`/mail/folders/${folderId}/empty`, {});
}
export function syncFolder(folderId: string): Promise<{ synced: number; error?: string }> {
return apiPost<{ synced: number; error?: string }>(`/mail/folders/${folderId}/sync`, {});
}
// ─── Mails ──────────────────────────────────────────────────────────────────
export function fetchMails(folderId: string, page: number, sortBy?: string, sortOrder?: string): Promise<MailListResult> {