Skip to content

Commit ec1cf3c

Browse files
authored
Merge pull request #46 from axeldunkel/fix/imap-sync-skipping-emails
Fix IMAP sync marking all emails as synced before fetching
2 parents aed0c96 + 9c9152a commit ec1cf3c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/backend/src/services/ingestion-connectors/ImapConnector.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ export class ImapConnector implements IEmailConnector {
189189
currentMaxUid = lastMessage.uid;
190190
}
191191
}
192-
this.newMaxUids[mailboxPath] = currentMaxUid;
192+
193+
// Initialize with last synced UID, not the maximum UID in mailbox
194+
this.newMaxUids[mailboxPath] = lastUid || 0;
195+
193196

194197
// Only fetch if the mailbox has messages, to avoid errors on empty mailboxes with some IMAP servers.
195198
if (mailbox.exists > 0) {

0 commit comments

Comments
 (0)