else if (config.getOAuthConfig() != null) {
// Use xoauth authentication.
OAuthConfig oauth = config.getOAuthConfig();
//noinspection ConstantConditions
String oauthString = new XoauthSasl(config.getUsername(),
oauth.clientId,
oauth.clientSecret)
.build(Protocol.IMAP, oauth.accessToken, oauth.tokenSecret);