imapserver: Add CONDSTORE and QRESYNC extension support
Implementing changes requested
Ref https://github.com/emersion/go-imap/pull/687 which contained the previous version of this PR.
I notice that this branch produces:
UID FETCH 1:* (FLAGS) (CHANGEDSINCE 123) VANISHED
I believe the following to be correct:
UID FETCH 1:* (FLAGS) (CHANGEDSINCE 123 VANISHED)
From: https://datatracker.ietf.org/doc/html/rfc7162#section-3.2.6:
The VANISHED UID FETCH modifier MUST only be specified together with the CHANGEDSINCE UID FETCH modifier.
There's also an example in that section of the RFC:
C: s100 UID FETCH 300:500 (FLAGS) (CHANGEDSINCE 12345
VANISHED)
Could we try merging CONDSTORE first, then do QRESYNC as a second step? Both at the same time are a bit much to review, especially since commits aren't split into semantic chunks. (I'd suggest opening a new draft PR based on this one for QRESYNC, then dropping the QRESYNC stuff from this PR. I can help with that if needed.)