How IMAP client can detact Gmail Label is renamed or newly created in server

subbareddy kuluru subbireddyg at
Fri Oct 25 07:33:32 BST 2013

I am working on Email client App and using GMAIL IMAP condstore capability
for syncing label,read and unread changes.

My application flow looks like below.

1) Initially Selecting the "Gmail/All Mail"
2) Fetching the changes from the server since last sync with last modseq
like FETCH 1:* (X-GM-LABELS) (CHANGEDSINCE highestmodseq)

Here IMAP server returns the messages for which label,read and unread
changes detected since last sync.

Suppose I have label "A" and it has got 100 emails. Now if Label A is
deleted then server returns 100 messages as changes,it works as expected.

But in case if label "A" is renamed to Label "B" then server should return
100 messages as changes but it won't.

Can you please suggest how to sync messages which are under Label A
previously and got renamed to Label B

PS: According to IMAP server standards uniqueness of a label is identified
based on label name and uid validity.

Gmail labels are retrieving with  command 'LIST "" "*"'.

Suppose if Label is renamed to some thing else then how to find whether it
was newly created label or the renamed label


Subbi Reddy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the OfflineIMAP-project mailing list