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.
source share