jmap.dev

Moving an app from IMAP to JMAP

If you've written IMAP code, most ideas carry over, but a few work differently. Here's what maps to what, and the habits worth dropping.

In IMAPIn JMAP
LOGIN or AUTHENTICATEAn Authorization header on each https request
SELECT a folder firstNo selecting. Filter with inMailbox instead
UID, only unique in one folderAn email id, the same wherever the message is
\Seen, \Flagged, \Answered, \DraftKeywords $seen, $flagged, $answered, $draft
COPY and MOVEChange the message's mailboxIds
A message in one folderA message can be in several mailboxes, like labels
UIDVALIDITY, CONDSTORE, QRESYNCA state string and /changes methods
IDLEEventSource, WebSocket or Web Push, for the whole account
SEARCHEmail/query with a filter
FETCH of bodies and partsEmail/get with body values, or download the blob
APPENDUpload the message, then Email/import
Sending through SMTPEmailSubmission/set
Special use foldersMailbox role
Folder paths with separatorsMailboxes with a parentId

Habits to drop

Things to handle

Most JMAP servers also speak IMAP, so you can move one part of your app at a time.

Words you don't know? See the glossary.

JMAP by example JMAP vs IMAP