From bd9495f284d0a80b24a8a9e5c05d9084507e8ac9 Mon Sep 17 00:00:00 2001 From: Patryk Bajer Date: Mon, 22 Jun 2026 16:58:35 +0200 Subject: [PATCH] fix: use Nodemailer's native OAuth2 auth for SMTP The raw xoauth2 field is not recognized by Nodemailer. Switch to type: 'OAuth2' + accessToken which Nodemailer handles natively. --- src/channels/email/smtp-imap/SmtpImapConnection.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/channels/email/smtp-imap/SmtpImapConnection.ts b/src/channels/email/smtp-imap/SmtpImapConnection.ts index 2d23557..dc32a0d 100644 --- a/src/channels/email/smtp-imap/SmtpImapConnection.ts +++ b/src/channels/email/smtp-imap/SmtpImapConnection.ts @@ -52,8 +52,9 @@ export class SmtpImapConnection extends EmailConnectionBase { secure: this.smtpSecure, auth: this.oauth2AccessToken ? { + type: 'OAuth2', user: this.smtpAuthUser, - xoauth2: Buffer.from(`user=${this.smtpAuthUser}\x01auth=Bearer ${this.oauth2AccessToken}\x01\x01`, 'utf-8').toString('base64'), + accessToken: this.oauth2AccessToken, } : { user: this.smtpAuthUser,