How reliable are UID IMAPs?

I am writing an IMAP crawler that is part of an open source application, and for incremental crawl I would like to use the message UIDs to find out if I saw any particular message or not.

Now I have found a 2007 message that says IMAP UIDs are not always reliable. More specifically, if the UIDNOTSTICKY flag is set, you cannot assume that the UIDs are always the same. So my question is: do I need to take UIDNOTSTICKY = true seriously, or IMAP servers with non-sticky UIDs, and not (widespread) usage?

+4
source share
1 answer

If the UIDNOTSTICKY response code is returned during SELECT or EXAMINE, you will also see that the UIDVALIDITY value in the mailbox (IMAP expiration time for the folder) changes every time you select or EXAMINE the mailbox. But you should check the UIDVALIDITY change anyway, since the UIDVALIDITY of the mailbox is not guaranteed to be unchanged, and any such change cancels your cached UIDs. Yes, UIDVALIDITY values โ€‹โ€‹usually do not change. But your code will deal with this case, and thus you will also consider the UIDNOTSTICKY case.

+8
source

Source: https://habr.com/ru/post/1332816/