Perhaps you can also store the labels, using the [X-GM-LABELS extension](https://developers.google.com/gmail/imap/imap-extensions#access_to_gmail_labels_x-gm-labels) as a json for each message? Otherwise, my understanding is that the labels are not part of the message and hence are not actually stored.
Perhaps you can also store the labels, using the X-GM-LABELS extension as a json for each message?
Otherwise, my understanding is that the labels are not part of the message and hence are not actually stored.