Fix IMAP sync marking all emails as synced before fetching #289

Closed
opened 2026-04-05 16:17:16 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @axeldunkel on 8/16/2025

Summary

Fixes #45 - IMAP connector skipping all existing emails during initial sync

Problem

The IMAP connector only syncs new emails but skips all existing/old emails in the mailbox. This happens consistently on every fresh ingestion setup, causing significant data loss.

Solution

Changed line 196 to initialize newMaxUids with the last successfully synced UID instead of the mailbox maximum:

- this.newMaxUids[mailboxPath] = currentMaxUid;
+ this.newMaxUids[mailboxPath] = lastUid || 0;
*Originally created by @axeldunkel on 8/16/2025* ## Summary Fixes #45 - IMAP connector skipping all existing emails during initial sync ## Problem The IMAP connector only syncs new emails but skips all existing/old emails in the mailbox. This happens consistently on every fresh ingestion setup, causing significant data loss. ## Solution Changed line 196 to initialize `newMaxUids` with the last successfully synced UID instead of the mailbox maximum: ```diff - this.newMaxUids[mailboxPath] = currentMaxUid; + this.newMaxUids[mailboxPath] = lastUid || 0;
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OpenArchiver#289