UPDATE
The hotfix mentioned below has been released as part of Rebex components 2016 R1. See what's new.
Actually, Rebex Imap/Smtp does nothing more than simply passing the XOAUTh2 authentication token to the IMAP/SMTP server.
As the code works fine with Gmail it should actually work with any IMAP/SMTP server that supports OAuth2 (as long as you pass a valid access token).
However, after a recent upgrade of Outlook365.com servers (about a month ago) we discovered a bug in our TLS 1.2 implementation that made Rebex Secure Mail 2015R4.1 unusable with the new version of Office365.com. This is not at all related to OAuth, but this bug most possibly prevents you from connecting to these servers completely.
UPDATE
Both the TLS 1.2 problems and problems when connecting to imap-mail.outlook.com with XOAuth2 authentication are fixed in Rebex Secure Mail 2016 R1.
A hotfix is already available for download, so in order to connect fine to office365.com mail servers with TLS 1.2, download the hotfix.
Give it a try and let me know whether you are able to connect and login with OAuth2 to Outlook 365. If not, creating a log of communication is a good start. Send us the log, so that we are able to look into it.
(Registered customers, the full version hotfix is available on demand at support@rebex.net).
As to the Yahoo IMAP server - I do not know what could be wrong, I tried connecting to yahoo IMAP with this code:
Imap imap = new Imap();
imap.Connect("imap.mail.yahoo.com", SslMode.Implicit);
// prepare token
string pattern = string.Format("user={0}{1}auth=Bearer {2}{1}{1}", userEmail, '\x1', accessToken);
string token = Convert.ToBase64String(Encoding.ASCII.GetBytes(pattern));
// log in using OAuth 2.0
imap.Login(token, ImapAuthentication.OAuth20);
imap.Disconnect();
and their server seems to announce OAuth2. However according to this yahoo developer page, only some of their services use OAuth2, whereas some still seem to stick to old OAuth version 1 which is not supported by Rebex. The log might help as well if you turn to them for advice and/or you should be able to find exact details at yahoo online doc.