In the past we used imap impersonation this way.
Imap imap = new Imap();
imap.Connect(...);
// credentials for authentication
string loginUserName = ...;
string password = ...;
// user name of impersonated user
string mailboxUserName = ...;
// construct a username for impersonation
string userName = mailboxUserName + "\0" + loginUserName;
// authenticate to the server
imap.Login(userName, password, ImapAuthentication.Plain);
Now we are using Office365 and OAuth authentication.
Is it still possible to use imap impersonation with Office365 (OAuth). If yes, how?