Confusing Mailspring with Gmail/Office365 interaction

I’m in a bit of a peculiar state, but I think I’ve found a bug or sorts in Mailspring.

We’re currently in the middle of a migration from Gmail to MS Office 365. I’ve migrated the mailboxes to a temporary domain within O365, however, my actual user in both systems is @. So when I’m trying to setup Mailspring as a client for O365, it does a seemingly correct OAUTH procedure, but it’s using the wrong server for that:

rawLog: '----------IMAP----------\n' +
    'connect <mailcore::IMAPSession:0x7ffc570b4680>\r\n' +
    '* OK Gimap ready for requests from 122.108.139.14 m26mb125211157ivt\r\n' +
    'ssl connect imap.gmail.com 993 2\r\n' +
    'OpenSSL version: OpenSSL 1.1.0f  25 May 2017\r\n' +

As one can see from the above debug log, Mailspring tries to login to GMAIL instead of O365. I’m guessing it’s because my MX record is still pointing to Gmail, but I’d say that is wrong, and it shouldn’t be affected by this as I’m setting up the O365 specifically, and even going through Microsoft’s OAUTH session in the browser.

I’m on Arch Linux, Mailspring version is 1.10.5-1ce06f18.

I would appreciate any hints.

Note I’m on Windows

Not sure how this has happened, was it a new account that was added or did you reconnect the old GMail account using the new O365 settings?

Regardless, the below may help

All the settings (apart from passwords) are stored in a config.json file. Mine is stored in my AppData folder. However it should be the same place as your keyboard binding preferences.

So if you:

  1. go to your preferences
  2. go to keyboard bindings
  3. click the view JSON link at the bottom
  4. when the folder opens, exit mailspring fully
  5. jump back to the folder and open the config.json file
  6. edit the settings to the correct O365 ones
  7. save the JSON file
  8. finally, re-open Mailspring