XOAUTH2 is supported but all the heavy lifting about refreshing access tokens etc must be done on your application side. Whenever IMAP API requires an OAuth2 token it makes a HTTP request to an URL you have defined and whatever is returned from that URL is the used to authenticate against the IMAP server. Here's an example of such an authentication server: https://github.com/andris9/imapapi/blob/master/examples/auth... Basically you would have to run your own and configure IMAP API to requests tokens from that server.