Your question
We’re currently only partially using JMAP, e.g. for push notifications / subscription.
When I receive a push e.g. for a new arrived mail, I get a JMAP messageId and need to convert it into an IMAP uid our system needs to update the list of mails.
With Stalwart v0.12 I send via IMAP a query for mails in the given folder with a Message-ID header matching the messageId I received.
This seem to have changed with v0.16, the JMAP messageId seems no longer the Message-ID from the mail headers.
How can I convert with v0.16 a JMAP messageId to an IMAP uid?
Ralf
The key point here is that the JMAP id for an email (as used in Email/get, Email/changes, push notifications, etc.) is Stalwart’s internal object identifier – it is distinct from the Message-ID header of the email. This is standard JMAP per RFC 8621. The correct approach to convert a JMAP email ID to an IMAP UID is to use JMAP itself to retrieve the header:Message-ID:asMessageIds property, and then use that for an IMAP SEARCH, OR – better – to use the JMAP Email/get call to get the full picture directly without ever needing IMAP.
However, the cleanest path for your described use case (JMAP push → IMAP UID) is to use the JMAP Email/get method to fetch the email by its JMAP ID requesting the header:Message-ID:asMessageIds property, then match with IMAP. But let me verify if there’s a more direct IMAP-UID-from-JMAP-ID path in the server source.