UIDL vs Message-ID

POP3 UIDL

Server-provided unique-id listing. Stable across sessions for as long as the message remains on that server/mailbox. Not guaranteed forever — server migration/reindex/restore can change UIDLs. Great as a fast incremental-sync key (don't re-download). Not ideal as a long-term global identifier.

RFC 5322 Message-ID

Email header set by the sending system. Usually stable and globally unique-ish. Caveats: some messages might not have it; some systems generate duplicates; you can't know it without parsing headers (need the bytes first). Good as an application-level identifier. POP3 doesn't let you request by Message-ID — only by message number/UIDL.

version1