diff --git a/lib/email-client/base-client.js b/lib/email-client/base-client.js index 140fe970..a8de7bbd 100644 --- a/lib/email-client/base-client.js +++ b/lib/email-client/base-client.js @@ -611,6 +611,10 @@ class BaseClient { } } else { oauthCredentials = await this.loadOAuth2LoginCredentials(this.accountObject, accountData, ctx, target); + if (accountData.oauth2.auth.delegatedUser && target === 'smtp') { + // override SMTP username, do not use the shared user + oauthCredentials.oauth2User = accountData.oauth2.auth.user; + } } return oauthCredentials; diff --git a/lib/email-client/outlook-client.js b/lib/email-client/outlook-client.js index b553d2ad..68855dec 100644 --- a/lib/email-client/outlook-client.js +++ b/lib/email-client/outlook-client.js @@ -2080,8 +2080,6 @@ class OutlookClient extends BaseClient { path = [].concat(path || []).join('/'); - console.log('RESOLVING FOLDER', { path, options }); - let cachedListing = await this.getCachedMailboxListing(); let mailboxListing = cachedListing || (await this.getMailboxListing());