Merge pull request #46 from axeldunkel/fix/imap-sync-skipping-emails

Fix IMAP sync marking all emails as synced before fetching
This commit is contained in:
Wei S.
2025-08-17 17:28:31 +03:00
committed by GitHub

View File

@@ -189,7 +189,10 @@ export class ImapConnector implements IEmailConnector {
currentMaxUid = lastMessage.uid;
}
}
this.newMaxUids[mailboxPath] = currentMaxUid;
// Initialize with last synced UID, not the maximum UID in mailbox
this.newMaxUids[mailboxPath] = lastUid || 0;
// Only fetch if the mailbox has messages, to avoid errors on empty mailboxes with some IMAP servers.
if (mailbox.exists > 0) {