Skip to content

Commit c4ca913

Browse files
committed
fix(oauth-smtp): Fixed authentication username for shared outlook SMTP accounts
1 parent 1463506 commit c4ca913

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/email-client/base-client.js

+4
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,10 @@ class BaseClient {
611611
}
612612
} else {
613613
oauthCredentials = await this.loadOAuth2LoginCredentials(this.accountObject, accountData, ctx, target);
614+
if (accountData.oauth2.auth.delegatedUser && target === 'smtp') {
615+
// override SMTP username, do not use the shared user
616+
oauthCredentials.oauth2User = accountData.oauth2.auth.user;
617+
}
614618
}
615619

616620
return oauthCredentials;

lib/email-client/outlook-client.js

-2
Original file line numberDiff line numberDiff line change
@@ -2080,8 +2080,6 @@ class OutlookClient extends BaseClient {
20802080

20812081
path = [].concat(path || []).join('/');
20822082

2083-
console.log('RESOLVING FOLDER', { path, options });
2084-
20852083
let cachedListing = await this.getCachedMailboxListing();
20862084
let mailboxListing = cachedListing || (await this.getMailboxListing());
20872085

0 commit comments

Comments
 (0)