Use CONDSTORE for modification sequence tracking
masterIf the server supports the CONDSTORE capability (RFC4551), you can track changes using the modification sequence (modseq).
Key features:
- Connection 'update' event: May contain a
modseqproperty (string) representing the new modification sequence value. - search() with MODSEQ: Using
MODSEQas a criteria changes the callback signature tocallback(err, UIDs, modseq). Themodseqreturned is the highest modification sequence value among the results. - fetch() with changedsince: You can use the
changedsincemodifier (string) to only fetch messages that have changed since a specificmodseq. - Box status: The
Boxtype returned byopenBox()orstatus()may include ahighestmodseqproperty (string).
Conditional Flag/Keyword methods:
The following methods allow performing actions only on messages that have not changed since a specific modseq:
addFlagsSince(source, flags, modseq, callback)delFlagsSince(source, flags, modseq, callback)setFlagsSince(source, flags, modseq, callback)addKeywordsSince(source, keywords, modseq, callback)delKeywordsSince(source, keywords, modseq, callback)setKeywordsSince(source, keywords, modseq, callback)
Note: All these methods have seqno-based counterparts.