I'm writing an IMAP crawler, which is part of an Open Source app, and for incremental crawling I'd like to use the message UIDs to find out whether I've already seen a particular message or not.
Now I found a post from 2007 that says IMAP UIDs aren't always reliable. More specifically, if the flag UIDNOTSTICKY is set, you can't assume the UIDs are always the same. So my question is, do I have to take the case UIDNOTSTICKY=true seriously, or are IMAP servers with non-sticky UIDs legacy stuff and not in (widespread) use anymore?
If the UIDNOTSTICKY response code is returned during a SELECT or EXAMINE, you'll also see that the UIDVALIDITY value on the mailbox (the IMAP term for a folder) changes every time you SELECT or EXAMINE the mailbox. But you have to check for a change in UIDVALIDITY anyway since the mailbox's UIDVALIDITY is not guaranteed immutable, and any such change invalidates your cached UIDs. Yes, UIDVALIDITY values generally don't change. But your code's going to have to deal with that case, and by doing so you'll have also covered the UIDNOTSTICKY case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With