GNU bug report logs - #78366
30.1; auth-source-xoauth2-plugin conflicts with multiple Google accounts

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Anush V <j@HIDDEN>; Keywords: fixed; Done: Robert Pluim <rpluim@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 26 May 2025 13:17:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 26 09:17:59 2025
Received: from localhost ([127.0.0.1]:56079 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uJXiI-0006RN-EC
	for submit <at> debbugs.gnu.org; Mon, 26 May 2025 09:17:59 -0400
Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:59871)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>)
 id 1uJXhF-0006MZ-Qw; Mon, 26 May 2025 09:16:54 -0400
Received: by mail-wr1-x429.google.com with SMTP id
 ffacd0b85a97d-3a4c4e6a0ccso1598761f8f.3; 
 Mon, 26 May 2025 06:16:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1748265407; x=1748870207; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=ml1XxGwSi0na/wwwqr2ZCMTthSXuyTdafCPRbRFTNnY=;
 b=PxSUWfXDKVwaKhNP5UxKPQhwGni14GZlhiaDO6IuJPqsXBBevO8mgVTBi4L0oKa5wZ
 XJSPXSRs/lDJ8FsGKp0egqZ9BditXk9euplNR1FwAW/95qUIoSCcPsUj2jHhZkJA2BxU
 F2TS3M8nJ6IYKUYZmPTUcW9Bx8me3hS47zZY2mB+hDnyN6bMMIqfW3rXR88zkR44Fa9z
 nX2txBB/uRz0BzWH3g2VSwskUQbBqP5/jPGSfxNKxKfBMUt1Of4dM1wu8alxM/rbl24t
 wEV/Fq4wITl066gl+GiE82vUDhINZ7Ma9o+wrjs8fhkj2cnPAXNx9RV9pVuSnC4AFguX
 oy3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1748265407; x=1748870207;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=ml1XxGwSi0na/wwwqr2ZCMTthSXuyTdafCPRbRFTNnY=;
 b=dDbRdxPHsrmzL2EqhSu+1Tol6rZJpncPW0OrfQ1Gy6qJoF2QPIPAqTwuJanxQQaHGH
 DcJD2NDxMcj439xURllXti4ZTaYtOOuFkwxUt/KjyaQkrRLOdWSkn/Unybj1ZL5czJK2
 LkLnMTB+Dbrif7V1TH0HzKMm53gGEeQTlzjp9e7w5D83rB7Ft+wwzGVyHmvOgFnedaFx
 5T8sMUaLpyjcMAQ6Krg1+P1430cdFA0+bU4jOFGhEPHwLtCWthZGmrUgEtVCQrajGkhC
 RPDYHYIMK8t8vSIuk7aNvvEZq8UayIQdeFC7oM437EXYqEIjSOdD4yRPaK3Ohek1BLlE
 DcFw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVPdRUZhbXeEIOiP5p+/3ByxFr3LWMnSGXzQlDqJyyP8Srz4SwnZ1NAeAEr+kDyC0jSmTeUJkBFTw==@debbugs.gnu.org,
 AJvYcCXW59x+Qm40e7Btxb4vjyS+rWZ1pK2CwLZBrwXAxdMED06lpKWHHKfzda+hnanjESB4J4XbnA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwFmlytnNVbXHo0y49zCWA69HiNQQ1KapkdDLGbd5R6S4dVXzG/
 MhTEkFl6Vxl8kjByZv5EIfz7cMhnw2ajpbHKLxw+A29o5kW/n8nwlL0SL78cxGsd
X-Gm-Gg: ASbGnctvGnhUaKq/EE4xCjWsv2QfJr5vW2UpVY4H/lEaby/mB++JNZNIov+3cv2cviY
 mxROid7BIfsPiRLVyAVHo4FDuddWcvgSG+sk2ze7NMQgHQnXXEidUPLOL9uvBjx50jczvYNgLPM
 uJO2TK2CK7BQiI6bOsntLTSjN2gBumTwwb/orsgM5+7y0xp3AZ7gYdg58gMfYDltEaSvoShU2K4
 0NduSDv8fPTWrWQcclLii3zeUt1K0nICS/NUmocOgMSxCwi6JdlOcC2uh477t6HfJoEfZplvDxc
 uSN085/jatufg9yAmXLh4CzsbfEg2xxUlHlg+x8=
X-Google-Smtp-Source: AGHT+IEaW9Tb+Bz9PTblqf2mFZu3UKw++fgWwDNf0Oz/HW5fgn44WroIY/0YZjU6GcvJWtQFBkL7wg==
X-Received: by 2002:a05:6000:230b:b0:3a4:dc80:b90d with SMTP id
 ffacd0b85a97d-3a4dc80bb66mr1979306f8f.5.1748265406992; 
 Mon, 26 May 2025 06:16:46 -0700 (PDT)
Received: from rltb ([2a01:e0a:3f3:fb51:633a:c728:b3f1:ab00])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-447f1ef032esm243239615e9.9.2025.05.26.06.16.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 May 2025 06:16:46 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <86a56zzhz6.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
 <87r00qky5p.fsf@HIDDEN> <87msbd3rgf.fsf@HIDDEN>
 <87cyc8512o.fsf@HIDDEN> <87ecwbx0k1.fsf@HIDDEN>
 <87msazd5dr.fsf@HIDDEN> <86a56zzhz6.fsf@HIDDEN>
Date: Mon, 26 May 2025 15:16:46 +0200
Message-ID: <87iklncy0x.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, j@HIDDEN, manphiz@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 78366 fixed
close 78366 31.1
quit

>>>>> On Mon, 26 May 2025 15:14:53 +0300, Eli Zaretskii <eliz@HIDDEN> said:

    >> Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
    >> From: Robert Pluim <rpluim@HIDDEN>
    >> Date: Mon, 26 May 2025 12:37:52 +0200
    >> 
    >> >>>>> On Mon, 26 May 2025 01:01:50 -0700, Xiyue Deng <manphiz@HIDDEN> said:
    >> 
    Xiyue> Friendly ping.  Does the patch look acceptable for smtpmail.el?
    >> 
    Xiyue> P.S. I have auth-source-xoauth2-plugin 0.2.1 released with the
    Xiyue> workaround.  Please check it out.
    >> 
    >> Looks good to me.

    Eli> Thanks, feel free to install on the master branch.

Done.

Robert
-- 

Pushed to master.

53371c95946 2025-05-26T15:07:24+02:00 "Make xoauth2 auth fail when a smtp server replies 334 (Bug#78366)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=53371c959462a677a29ee869b3b6627facf3ed79





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.
bug marked as fixed in version 31.1, send any further explanations to 78366 <at> debbugs.gnu.org and Anush V <j@HIDDEN> Request was from Robert Pluim <rpluim@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) fixed. Request was from Robert Pluim <rpluim@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 26 May 2025 12:15:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 26 08:15:09 2025
Received: from localhost ([127.0.0.1]:55627 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uJWjU-0001my-HM
	for submit <at> debbugs.gnu.org; Mon, 26 May 2025 08:15:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33680)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uJWjQ-0001lo-U4
 for 78366 <at> debbugs.gnu.org; Mon, 26 May 2025 08:15:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uJWjL-00083I-Ah; Mon, 26 May 2025 08:14:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=kcPdW8iD3Do404dXzXz4kGaU7QwfwFuKlvt7QDIS6/8=; b=QMMtfndeUPoU
 XNTertq7bKteMhtWTLFkkjtvpJs+Vktxf6VcXaSWSVTU7c4OusuTPhCctkSAm9VYOD0fhGofl30h5
 ASceOVe7vnaK7Pew903pBCxtLnzRIWeAbNjc9JTeWdRI1LzYYu/FoJwY7xL4ICx+wPTgHcclWyXt4
 9yO+nRzAN+JNBDeRRhpsD/vkxTNvisfTqyKiuipGQWRtJDcqYSD89kyNBz1p+synT8bWsb+c2N+4u
 9fD8TcnPV1/qJtDQiLrdqQx/5F8Bp2+w4MOaHz3023r8tQj6JGZO/GmODNsZ3cXAwoHC7khSRjqBe
 jOJLks1nHYgJmcZe+Ajeaw==;
Date: Mon, 26 May 2025 15:14:53 +0300
Message-Id: <86a56zzhz6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>
In-Reply-To: <87msazd5dr.fsf@HIDDEN> (message from Robert Pluim on Mon, 26
 May 2025 12:37:52 +0200)
Subject: Re: bug#78366: 30.1;
 auth-source-xoauth2-plugin conflicts with multiple Google accounts
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
 <87r00qky5p.fsf@HIDDEN> <87msbd3rgf.fsf@HIDDEN>
 <87cyc8512o.fsf@HIDDEN> <87ecwbx0k1.fsf@HIDDEN>
 <87msazd5dr.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, j@HIDDEN, manphiz@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
> From: Robert Pluim <rpluim@HIDDEN>
> Date: Mon, 26 May 2025 12:37:52 +0200
> 
> >>>>> On Mon, 26 May 2025 01:01:50 -0700, Xiyue Deng <manphiz@HIDDEN> said:
> 
>     Xiyue> Friendly ping.  Does the patch look acceptable for smtpmail.el?
> 
>     Xiyue> P.S. I have auth-source-xoauth2-plugin 0.2.1 released with the
>     Xiyue> workaround.  Please check it out.
> 
> Looks good to me.

Thanks, feel free to install on the master branch.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 26 May 2025 10:38:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 26 06:38:03 2025
Received: from localhost ([127.0.0.1]:54867 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uJVDX-0005d4-6y
	for submit <at> debbugs.gnu.org; Mon, 26 May 2025 06:38:03 -0400
Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:58620)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1uJVDU-0005c8-7t
 for 78366 <at> debbugs.gnu.org; Mon, 26 May 2025 06:38:00 -0400
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-3a375888197so1196763f8f.0
 for <78366 <at> debbugs.gnu.org>; Mon, 26 May 2025 03:38:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1748255874; x=1748860674; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=spWNkHHXYp45yl/BBqX/3bwIYgowV3/gBc4gVUXEzR4=;
 b=AjupUHWpM8L1iuZcpUz2W3FMu7yLE8asMihldNzq8u8dnlr/L6EwMEQolFLwb3tr2E
 x6AV4pzvpG+VygHiglxKx56oMF70EACl3MDoUjopcF3bne+9XOSXDDrR/IMoLJux/8JB
 nS3rrNl2vwJ+snol2ZKI5EnO9IvpJoJWkmORIGV9CBglCWnxcaUydbLfPYcQ7XOkUScv
 LZ8ERg+eeaC9GFhYPF9dg/peOI8BpRQIXAVodI6polimBY2MDsbu3mK525oJZPmIwt1Q
 8n0j3wxS8+sanCRrfcOf3Upqt77EkEvqNYczqHp+4BL/VwwLU7Y3CobS3hR08NWuR06w
 WhnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1748255874; x=1748860674;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=spWNkHHXYp45yl/BBqX/3bwIYgowV3/gBc4gVUXEzR4=;
 b=ApkYmMSsQGl0XKCbN42xYWlR4uvoP5PPCtF2Q57SSFtQOUaFWvGMOz3mFKgziXw77o
 yHK5RkEf3WrqHEC0GefsyG7uMRtbZGMHSM+RCJWMlC6BLA9wLwep1mZmOGpi9W1ewHEo
 aa3ctby11wnsxKlcir77bgOkCBe6Pyp++nLwygXhcfatGyeiDn0vYxMMgFqgZ2lUxZya
 CZKF+9HBATQ3eBC+fUz8TZy3yLZnA2Oo8/ahPmlL8MUxnggzq7U6mbJ1Oi5toFsOb7eI
 AB7ZpM5kkAC6gaG74q/OF8e/uJJJ9UbdM9jOpX4kZmEm4q0SC2xi4B8Ot3ABJ0zNIV30
 HLFQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWUQi7p5T4w/AyOuRzcHDy0E3t0PK7LUNDGBNldCypFoFXVlupIFd9oY/4dueS2vQAUoDa+QA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yxl7sFeJsFw2ZlyycZTumpruz5IlF6Dgqi+NTNK/r36Q6OLeVhc
 AXTW97N+eAtnAFGx/wYB7bxx8D19JWBfJUwFS03u5z2ZrctPd/f+FfnbhNlHdndA
X-Gm-Gg: ASbGncv16yRmIFTkb6uOkKHPGDr7XAjVnueReugHVjkjsG0YFiHTp3MNnCPWhBN3Txy
 sSa7Rhh8HPsSLFDD/ByUkQpr/Yf7GEKzwQ/DyN2xCNcatLK9OvykBm6xWbOaoDJyBGs8aRyyJAs
 MuZIvGc3cx7XDnYGcKpM4M+/tfoBQuO8NKJHvuV4iG0kYG5H6cP128B5UxQJQkFj+I7E1o4j4ev
 schkOlbA983vxgVY6/0rKWEAAoTVBSmNdmu/vON0Kz5MfllFG3GEx6OJN3yEkaP5cA26scJ8Tid
 X4oo3YdiyVAiychRIkiqQJm18c5ZFZck48lxUE+sz8xnVpMG9A==
X-Google-Smtp-Source: AGHT+IGewplvAHUCfYNFsVkqXAC3x7WbX+82osUUcLSv4eiWOQVpX5xw7BIvdC2DDuMAIWj6G0wpNw==
X-Received: by 2002:a5d:588f:0:b0:3a0:8495:cb75 with SMTP id
 ffacd0b85a97d-3a4cb449dfemr6694692f8f.9.1748255873579; 
 Mon, 26 May 2025 03:37:53 -0700 (PDT)
Received: from rltb ([2a01:e0a:3f3:fb51:633a:c728:b3f1:ab00])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-44ab793a7d5sm144362865e9.1.2025.05.26.03.37.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 May 2025 03:37:53 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Xiyue Deng <manphiz@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87ecwbx0k1.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
 <87r00qky5p.fsf@HIDDEN> <87msbd3rgf.fsf@HIDDEN>
 <87cyc8512o.fsf@HIDDEN> <87ecwbx0k1.fsf@HIDDEN>
Date: Mon, 26 May 2025 12:37:52 +0200
Message-ID: <87msazd5dr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Mon, 26 May 2025 01:01:50 -0700, Xiyue Deng <manphiz@HIDDEN> said:

    Xiyue> Friendly ping.  Does the patch look acceptable for smtpmail.el?

    Xiyue> P.S. I have auth-source-xoauth2-plugin 0.2.1 released with the
    Xiyue> workaround.  Please check it out.

Looks good to me.

Robert
-- 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 26 May 2025 08:02:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 26 04:02:04 2025
Received: from localhost ([127.0.0.1]:53667 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uJSma-0007ms-6I
	for submit <at> debbugs.gnu.org; Mon, 26 May 2025 04:02:04 -0400
Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:52585)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <manphiz@HIDDEN>) id 1uJSmX-0007m7-D5
 for 78366 <at> debbugs.gnu.org; Mon, 26 May 2025 04:02:02 -0400
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-231e8553248so13668015ad.1
 for <78366 <at> debbugs.gnu.org>; Mon, 26 May 2025 01:02:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1748246515; x=1748851315; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=0ryNZPB6TdKRuyy86HobBhnCAxrz/fvP4QH0N+e9zGE=;
 b=YWD/soxquulIFJyF4aZHnv3hc6vzwJfxnEjg2RGTi/iHIPg4AboeN+hH7E7x+OT+db
 dr3GG0tUNpNWWn6j7Iyum9VEsgOb53KqE1+j0hKXZ+GK0EUzZ7eONSN6/bqYteO8vJeI
 nAeQ80V8zRMW7d1d2bU9bcznVyhpYKAU64AW8uLAVtI+9briG+EVTsjkb5EjqsExcuMu
 DMMQ3k/2wq6h75xdcN+v06636s/d5Nqf5DTejrb59FhKmbk1nJlqfxhCa/vYfeMj8GQ3
 87iJGUWYXyjHjEyhh269E+VCZah8UV6tbX9XZvlLCcfuhzzbnf/jm/NcJydPsy8o3M9a
 8SnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1748246515; x=1748851315;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=0ryNZPB6TdKRuyy86HobBhnCAxrz/fvP4QH0N+e9zGE=;
 b=jgU4akRbbTOjb9mye1Zh4vqynFtA++p5Ha0ayWceR+xSryoV1G34Yh9WwrAD9Z5QOZ
 i1W+upKyafouYnS7t0z1gET7jKh0K2qs0hSJGPqvCq7glpv3cYZsIM+Uk5fRs5J4F2Z5
 TuimP5tG2vX0H72qv1cEGmsJfCPFyUHMrlF8OfggGf+nI5P2K1rk2ZFw+VVMPNEJXQ7V
 eum2NltmFWhotHBXRRXLDIL3smrciysyakrEIC5U2Gx0fMK1nJAHR4I93MVBMhI0su3q
 GCc8m7WogRc9D27pve2O2NOzWjegUSANqWcMGN30WUdBg5ltqEuJz05PWRWBFa3Gn4Xp
 19nA==
X-Forwarded-Encrypted: i=1;
 AJvYcCXttJeqZIOJ3G/R3Z9NFbO8wCClpwXFw2Oif1wTBNVpQkBVREdz8dZiNtnTTX3ziHW+XTyXDw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzfBbt441cyGbAeoA1UtNAHvLItB84hU8Usqoo63FbXJSVdexXl
 OsRO93byiOH7GXbvqILdbtSdTxdUOddK2t/ui6bqUK+S9fux3BxVXtzNoKmcgw==
X-Gm-Gg: ASbGncugF2ic+h2OaUpOxYDjeml+36pAFNzNkkhMiOba6EGAOJKfLoEAVHyUOiq3Yw1
 dnH1LMRS6/riU4Z5m3T7wWdB9h+gLIA5EJVTjzSDDg//Yo1J/KzBz4Qm36T6uFzaJgarA0zQP1g
 ZHd9U8D9K10maRG5w6o0cAR0Qs30libWi8zFkXayLhNFTqUa7IjBpijpJf8n31X8B/WyiTmf82X
 EPl/KUNYP64bZvGo2FvtdurseJqvC62BN8UW8Cy6YErj0huZaK6BKaY0+6qMvjX1QFxBrAB++AY
 Z7WsK5ZusbtS/Hc1wnJCaRGy3RfegEm5Ya0RhYckOftt5QGedsV3bF3SLYLpleaifMHnyAft6O4
 xRBcyHeGChQ==
X-Google-Smtp-Source: AGHT+IFYuBsbLhwD+qtcYjGK522RVMlw7wMIqb4mzkzM0pLuL2TxoBJLsfFJ8t/kFjbPOTZC3B4vbA==
X-Received: by 2002:a17:902:d2d1:b0:22f:a932:5374 with SMTP id
 d9443c01a7336-23414fc9852mr149236895ad.48.1748246514789; 
 Mon, 26 May 2025 01:01:54 -0700 (PDT)
Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com.
 [76.94.249.45]) by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2342d85dfa3sm27954765ad.44.2025.05.26.01.01.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 May 2025 01:01:54 -0700 (PDT)
From: Xiyue Deng <manphiz@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87cyc8512o.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
 <87r00qky5p.fsf@HIDDEN> <87msbd3rgf.fsf@HIDDEN>
 <87cyc8512o.fsf@HIDDEN>
User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1
 (x86_64-pc-linux-gnu)
Date: Mon, 26 May 2025 01:01:50 -0700
Message-ID: <87ecwbx0k1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Xiyue Deng <manphiz@HIDDEN> writes:

> Xiyue Deng <manphiz@HIDDEN> writes:
>
>> Hi Robert,
>>
>> Robert Pluim <rpluim@HIDDEN> writes:
>>
>>>>>>>> On Thu, 15 May 2025 00:17:02 -0700, Xiyue Deng <manphiz@HIDDEN>=
 said:
>>>
>>>     Xiyue> Thanks for the insights! I managed to reproduce the issue, a=
nd during
>>>     Xiyue> debugging I got the list from the reply as Anush mentioned. =
 Turned out
>>>     Xiyue> that the return code was 334 server challenge[1], so it was =
waiting for
>>>     Xiyue> the correct user and password.  Sometimes this was directly =
considered
>>>     Xiyue> authentication unsuccessful for Gmail[2].  `smtpmail-ok-p' c=
onsiders a
>>>     Xiyue> return code less than 400 as successful, and only has challe=
nge handling
>>>     Xiyue> implemented in cram-md5.  As we should be providing the corr=
ect
>>>     Xiyue> credentials directly in xoauth2, 334 is effectively a failur=
e.
>>>
>>>     Xiyue> Maybe in `smtpmail-try-auth-method' for xoauth2, if we see r=
eturn code
>>>     Xiyue> 334, we should change the return value to "535 5.7.8 Authent=
ication
>>>     Xiyue> credentials invalid".  Would like to see whether the Emacs m=
aintainers
>>>     Xiyue> this is a good idea.
>>>
>>> It=CA=BCs either that, or change `smtpmail-ok-p' to accept a second
>>> optional parameter for which codes to accept for success, which seems
>>> like overkill here.
>>>
>>
>> In this case it's more like which codes not to accept (334), but I agree
>> `smtpmail-ok-p' is probably the wrong place to handle that.
>>
>> I'll work on a patch for `smtpmail-try-auth-method' later.
>>
>
> A draft patch is attached, please take a look.
>

Friendly ping.  Does the patch look acceptable for smtpmail.el?

P.S. I have auth-source-xoauth2-plugin 0.2.1 released with the
workaround.  Please check it out.

> --=20
> Regards,
> Xiyue Deng
> From 8de2535105c1fac14ab6c5fef792435b21a0861f Mon Sep 17 00:00:00 2001
> From: Xiyue Deng <manphiz@HIDDEN>
> Date: Fri, 16 May 2025 02:48:52 -0700
> Subject: [PATCH] Make xoauth2 auth fail when a smtp server replies 334
>  (bug#78366)
>
> * lisp/mail/smtpmail.el (smtpmail-try-auth-method): Throws error 535
> when receiving a "334 server challenge" reply.
> ---
>  lisp/mail/smtpmail.el | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
> index 9337ee9401a..eda91793d17 100644
> --- a/lisp/mail/smtpmail.el
> +++ b/lisp/mail/smtpmail.el
> @@ -642,11 +642,21 @@ smtpmail-try-auth-method
>=20=20
>  (cl-defmethod smtpmail-try-auth-method
>    (process (_mech (eql 'xoauth2)) user password)
> -  (smtpmail-command-or-throw
> -   process
> -   (concat "AUTH XOAUTH2 "
> -           (base64-encode-string
> -            (concat "user=3D" user "\1auth=3DBearer " password "\1\1") t=
))))
> +  (let ((ret (smtpmail-command-or-throw
> +              process
> +              (concat "AUTH XOAUTH2 "
> +                      (base64-encode-string
> +                       (concat "user=3D" user "\1auth=3DBearer " passwor=
d "\1\1")
> +                       t)))))
> +    (if (eq (car ret) 334)
> +        ;; When a server returns 334 server challenge, it usually means
> +        ;; the credentials it received was wrong (e.g. was an actual
> +        ;; password instead of an access token).  In such case, we
> +        ;; should return a string with 535 to indicate a failure so that
> +        ;; smtpmail will try other authentication mechanisms.  See also
> +        ;; https://debbugs.gnu.org/78366.
> +        (throw 'done "535 5.7.8 Authentication credentials invalid")
> +      ret)))
>=20=20
>  (defun smtpmail-response-code (string)
>    (when string
> --=20
> 2.47.2
>

=2D-=20
Regards,
Xiyue Deng

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmg0H+4SHG1hbnBoaXpA
Z21haWwuY29tAAoJEC3pZe1jglyToiQP/iZn465B/gXPcA5XxQZiAJiRIMVpacr5
E7F+nXwBTMEdPuNNb/k+OMxtOmgfxP21mNFa8BOmfiJO+5NkRsWNz9nH7kYx2weI
khDFdrASeYQlxkxMVPVzAGsTtu1+dV9ot+f+0u3WKh/5YhHD5IbZJRm9FbXvc0E7
LXFIZWotjk0+q/vVRYjsu8px+AHCYwBk3n6WENMiCifOuCTml9m/y0m4npybgY4Y
Lta2s80s94R9xNJapipbA1xcc+d2IHS4jwZMETznpyRj2r5dodVPCzadMBf0MGwk
CDbf+vAfQsZ/Q3HirVJqShCnxHr4hLzZ2dCTGkfjls/3/Jq043eiVhr7/pRThVSZ
vJyXQGbpbfWofk8MK37uX6ceT0qKVoOdmOG63z6g7U62vfrlXCg8Rgj/3IFU4NoL
glcXEbsaNyPXdB3nvn6+8KgCV3eXxr1eaL8M10tbmLYiCzjiwI7P6IyFRnQP+Fzw
ySnznqHcChwr3Hv38zrdhKaeSjgBXib4VX981ATMl+HvcQh6T9CbpOEOLgZTq7qQ
3WatteARC4B1JgIv5nGq/R19YY70iJoqJk8IGcGWQ0r3QLzfcflPryAQMyCDMECI
H330XwC0PSUGrr0c/GknMGfkwMWiTTE+HhedXXgG7ERh0kNoznlrbAlG5jvqRaHI
SSzvkHuP4kry
=VDfc
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 16 May 2025 09:58:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 16 05:58:50 2025
Received: from localhost ([127.0.0.1]:34999 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFrq6-0001Vn-HA
	for submit <at> debbugs.gnu.org; Fri, 16 May 2025 05:58:50 -0400
Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:46506)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <manphiz@HIDDEN>) id 1uFrq3-0001Ur-Tz
 for 78366 <at> debbugs.gnu.org; Fri, 16 May 2025 05:58:48 -0400
Received: by mail-pf1-x431.google.com with SMTP id
 d2e1a72fcca58-741b3e37a1eso2073138b3a.1
 for <78366 <at> debbugs.gnu.org>; Fri, 16 May 2025 02:58:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747389521; x=1747994321; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=peWv+G896AZVi9ajdU8+UUp6MoiZlF7lgLzLVsR4MpY=;
 b=bNZBuFo0LprBuzD8BmCkDHX4bkXiW1W7pZakdCSwDM288M/944z1OXejjm6OUKHM1l
 DCKS+1uti9iH3mJzsvsuWRKmMR8PfgAMj6Zo54L86kP5GES4tR1PMGKr4H0jJnVh2MnJ
 7c0jh0dxBIjdCp60RT6QhVXlzgfkbLW5Jq7w2fOTnyprIOcmneH3BtXuMH2yd4xKe5fd
 hlwgtiv914B0icHV4lmPvLOLmotirSmiG5ErvyASyX7gmW6iekfTtN37MoobobKLkNmU
 d8lvqom41UT46+7VeiVJIyo1WSayPAH0HFDmDOb1w1xYuZ3uTGMyKdxLP04lxzzMFoU3
 EmXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747389521; x=1747994321;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=peWv+G896AZVi9ajdU8+UUp6MoiZlF7lgLzLVsR4MpY=;
 b=VsunZZTcpi/zr3swrEO0T2vllBCptZq1IqaqdskgOez9GBB2YJW8xDuth2nHh0xDkk
 A3pvrn2EMQLxUM+AVTGA2ll7ODwzz8oAv17i6+YUeZZoGplGFwxAxmcT4XyWXJRKvdle
 Sm0A5kPXAp+4RGL18rMH2lc3ILKvLJJTFqCSCKoviM4kZt+xLpdYxjrSmz2ObE80M3rP
 /tGJmo0bnBiPUMenJtWxUVWSbA/foU2Qk/kwpcDdHPlimjN6ahd28anZMtsGu74vJJDN
 kZ1pDMACvej96b4geTPzLuQ0e5SSOVkaQo4C604GGthyzTifUP0aDxa+21w2aJD/qTZX
 R/ew==
X-Forwarded-Encrypted: i=1;
 AJvYcCXSb0mzqHgWM8ylO0gUG1GRGGLfs0OZM5eTxOf4cnmDZG4e4z30KCmsc+bdBVVWPDfRTsdCfg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxGQ9iN811XdaZrQaxR/3Wr4BYzGmq4rBYTYLqG5K2wm/VYh62z
 rDs6ijkvc3KanrEZFsqzS4lvVT50ZDGxdGoZTwdyVZsdmXwT3WasHCeQ5WgNmw==
X-Gm-Gg: ASbGncva3kgu2qoYDre4Kop+5u5GFAcnieGKbQ+xlNldh3lvsltvB2uy5T8EnrLiGAs
 3Fm+3jRLlQTo4W5LOtF3vuRMo+MoOpo97APwPaQbn80j+EPhvmCPyZbxVl93kECl387P3SQfPfm
 fIirzGUUUG16dw27JuAajwGbewCqlh8Qyvbx3Gz4gkxBkPkCty3iRvCh5wwjx4WSsAqkGfB6r3z
 LL9bkcGyhnfrIqA7JvbdYUU7VLLhMGsJ6+MJW2U+FFO8HSnD7hgPtjhFQnM3mWPsfFQhDa3gEMq
 KphfeWi3KJHobDMMiaCAIDMqgVStoN3o5vfsHsyHvMR+9va3fH8FMp7TqwLhM9U2YjuTQ5/fSyc
 nVuaVVsEFfA==
X-Google-Smtp-Source: AGHT+IFQWLZTHZ4Me2TFE6glXU9GvLBQpXtI8AUjwezWBM8NrAD4mIMyVWac8M2CNiz3YoFtfjp2NQ==
X-Received: by 2002:a05:6a00:3694:b0:740:596b:eaf4 with SMTP id
 d2e1a72fcca58-742a98a31f4mr3559602b3a.16.1747389521332; 
 Fri, 16 May 2025 02:58:41 -0700 (PDT)
Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com.
 [76.94.249.45]) by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-742a9876da1sm1200930b3a.137.2025.05.16.02.58.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 16 May 2025 02:58:40 -0700 (PDT)
From: Xiyue Deng <manphiz@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87msbd3rgf.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
 <87r00qky5p.fsf@HIDDEN> <87msbd3rgf.fsf@HIDDEN>
User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1
 (x86_64-pc-linux-gnu)
Date: Fri, 16 May 2025 02:58:39 -0700
Message-ID: <87cyc8512o.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Xiyue Deng <manphiz@HIDDEN> writes:

> Hi Robert,
>
> Robert Pluim <rpluim@HIDDEN> writes:
>
>>>>>>> On Thu, 15 May 2025 00:17:02 -0700, Xiyue Deng <manphiz@HIDDEN> =
said:
>>
>>     Xiyue> Thanks for the insights! I managed to reproduce the issue, an=
d during
>>     Xiyue> debugging I got the list from the reply as Anush mentioned.  =
Turned out
>>     Xiyue> that the return code was 334 server challenge[1], so it was w=
aiting for
>>     Xiyue> the correct user and password.  Sometimes this was directly c=
onsidered
>>     Xiyue> authentication unsuccessful for Gmail[2].  `smtpmail-ok-p' co=
nsiders a
>>     Xiyue> return code less than 400 as successful, and only has challen=
ge handling
>>     Xiyue> implemented in cram-md5.  As we should be providing the corre=
ct
>>     Xiyue> credentials directly in xoauth2, 334 is effectively a failure.
>>
>>     Xiyue> Maybe in `smtpmail-try-auth-method' for xoauth2, if we see re=
turn code
>>     Xiyue> 334, we should change the return value to "535 5.7.8 Authenti=
cation
>>     Xiyue> credentials invalid".  Would like to see whether the Emacs ma=
intainers
>>     Xiyue> this is a good idea.
>>
>> It=CA=BCs either that, or change `smtpmail-ok-p' to accept a second
>> optional parameter for which codes to accept for success, which seems
>> like overkill here.
>>
>
> In this case it's more like which codes not to accept (334), but I agree
> `smtpmail-ok-p' is probably the wrong place to handle that.
>
> I'll work on a patch for `smtpmail-try-auth-method' later.
>

A draft patch is attached, please take a look.

=2D-=20
Regards,
Xiyue Deng

--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Make-xoauth2-auth-fail-when-a-smtp-server-replies-33.patch
Content-Transfer-Encoding: quoted-printable

From=208de2535105c1fac14ab6c5fef792435b21a0861f Mon Sep 17 00:00:00 2001
From: Xiyue Deng <manphiz@HIDDEN>
Date: Fri, 16 May 2025 02:48:52 -0700
Subject: [PATCH] Make xoauth2 auth fail when a smtp server replies 334
 (bug#78366)

* lisp/mail/smtpmail.el (smtpmail-try-auth-method): Throws error 535
when receiving a "334 server challenge" reply.
=2D--
 lisp/mail/smtpmail.el | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 9337ee9401a..eda91793d17 100644
=2D-- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -642,11 +642,21 @@ smtpmail-try-auth-method
=20
 (cl-defmethod smtpmail-try-auth-method
   (process (_mech (eql 'xoauth2)) user password)
=2D  (smtpmail-command-or-throw
=2D   process
=2D   (concat "AUTH XOAUTH2 "
=2D           (base64-encode-string
=2D            (concat "user=3D" user "\1auth=3DBearer " password "\1\1") t=
))))
+  (let ((ret (smtpmail-command-or-throw
+              process
+              (concat "AUTH XOAUTH2 "
+                      (base64-encode-string
+                       (concat "user=3D" user "\1auth=3DBearer " password =
"\1\1")
+                       t)))))
+    (if (eq (car ret) 334)
+        ;; When a server returns 334 server challenge, it usually means
+        ;; the credentials it received was wrong (e.g. was an actual
+        ;; password instead of an access token).  In such case, we
+        ;; should return a string with 535 to indicate a failure so that
+        ;; smtpmail will try other authentication mechanisms.  See also
+        ;; https://debbugs.gnu.org/78366.
+        (throw 'done "535 5.7.8 Authentication credentials invalid")
+      ret)))
=20
 (defun smtpmail-response-code (string)
   (when string
=2D-=20
2.47.2


--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmgnDE8SHG1hbnBoaXpA
Z21haWwuY29tAAoJEC3pZe1jglyTFWEP/jKVxK5syEHVVKcoJ2Wy6EwKj5p9dFrM
TqhIvRZiHkbf1w0gmFD/znSb0Wke6S6XmYPVYqEEfFpAjXrjGM/j28JKQRrm53+c
SJBeFyjsq2LzWw1ZlWP1ZERCL8grhhlfXJ9D1ZVolnlxyy/wLRg3jaM/heTEwKrp
MsNfIoWRO+aGyoh4yuN+Krf+rYPgQ0lIp1tMBLzyrvlVYoXY5IUTLdJ7Oz+nfl6s
vm5iwQYjK37Lo2SK7kq5TgjBf/mcEOMO081HcEIh9Rii1ah0bi7fibB4tTAteP8k
xUjPHLhPdwTtGr/q+USUeHLPCZPY9eL7vmFiJkiaaz6Rrt5V52yrPz0z7+Ly1O9k
y2cVtsb1+/onHwTKahsWELdp9dGk/l/ensfqfhvDRBq547Lrbi9qBwGQJTngpDNK
7wLIICEMlvPSmKAbDwrBe4BjEHpnHr9x57IKl4u34p271K8RtOrW+SGokS72fdiY
FRif0tmod3iXVxpuQ1VSYCAPSjMNXJVVNabYewlVhFAbJzdozmDg0+kkxEJFjW7J
kcBO2xLpcBri6EuZQuULQmNaA1wFdTzdaRlfiDivfpvqYG76BWOOufD7YabDcGlk
/L5xvedMabmScHJCAJz7hot6U+ZHSTMU24uqTcKzsx7aFl55Fsu6tin06HXemzqH
Ov1cF21hIfqG
=mBQx
-----END PGP SIGNATURE-----
--==-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 16 May 2025 08:12:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 16 04:12:10 2025
Received: from localhost ([127.0.0.1]:33893 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFqAs-0006E5-Ff
	for submit <at> debbugs.gnu.org; Fri, 16 May 2025 04:12:10 -0400
Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:51311)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <manphiz@HIDDEN>) id 1uFqAp-0006Cx-Bx
 for 78366 <at> debbugs.gnu.org; Fri, 16 May 2025 04:12:08 -0400
Received: by mail-pl1-x632.google.com with SMTP id
 d9443c01a7336-22c33677183so17133955ad.2
 for <78366 <at> debbugs.gnu.org>; Fri, 16 May 2025 01:12:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747383121; x=1747987921; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=FUsVYjGhpKw2eHphzfeADvsa9vLVAl2RhLP4XIG0yYM=;
 b=VGToxOtmH97hb70tfv2qcyuVwv6g6TzLTyhmzp4j8zRHygSS4iMBDz1t2RYS9hcQLO
 IxKql1McrD0suU8dzw9dTS0OBWT1sXw/f2zQSAbJaHZtapmarNGxmLVyqy3Rx2Q+oZ9b
 UWdmahFaDxu6N+HngXrK27Cp75ksO5P8ulIp+F+JhSvIJb66uJhYjQogbDbVOdGHs+LY
 y4oFOBeA1v7V8CR4SPqDcEdQuE0tlm49PS62UK7YWEwO5Lj9iIqm+ZG36/++/hW/QtsE
 5vkkVf4QyRD4BPT6zfZpNXiEaXrmXZx+2vdytx0vIZbNQv9a+6WV2ZxxkMeBaHiXG/Ov
 LlhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747383121; x=1747987921;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=FUsVYjGhpKw2eHphzfeADvsa9vLVAl2RhLP4XIG0yYM=;
 b=n/mo/qUTC3NtwrVwCuUaDbVdgLE3x17sZMCWfWnk+FcwNU3kIDElAPJWApC1oPUNgy
 M0WuoH4piOR9ojrpa018hV2NY01v6U8ZdIOOidlpqtPoxVdMig908NbkYxKiRjEXfsKe
 Zab2+bbt/5H4hq4MNaNGKByer76NhZHdHBBrQ8YarM4yVEqnoVOlLzNtOjpXDsPWk/Jo
 sG8kHVYNIUuuAQaHbRO1Yfkw3C1OaMSanUkJuleY/mWeDjdGpgYxz2FR2MCtYA7mRuzQ
 WwwTHPXnHQ1kxMIsm3cwgHXRzYRtjkf82ZBvAZ3TotL94i6s3hgDNXX7mm9nF7JSKxnQ
 3YyA==
X-Forwarded-Encrypted: i=1;
 AJvYcCXJj5oWFLa0LsnLbEYc4xG5WtdUqlNGSsGTnyRdzQN9nXzd6TV8Sr9XAkQt5N0mVSvTYUqcWA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YymiaqaaFDm4/CZJtqxv70u0ZFoN1n8GrOV9HkE94raNaEjkm2t
 LXBKfMXB3cO+K3CVcGSSSg6feA5xbW3Qu/kEzxrFFxFsGf6qMKwtoAW4gZdWtQ==
X-Gm-Gg: ASbGncvXdOQpAAvZwUZdvHWQbYsYz0mh0PfzDkCUTHEUcaU6i8WgJ+rM5df/Ytacfvf
 8NEtRRoD7fjQ26DWknQDLhuUMRPbRcJOCVXP7gO7QO/r6BYO0wd9x0pi18BWBpwAtgTUz9havcN
 G3Lt3TyTL9GINYkHh/8MTKQwlRTwD39UYJj/uxkIBsfsKjUzJWB2wsn9dXbr38Bs23ma0Xd0mfk
 bReC881PmhqMwXuomCmzZaLSHtvNtqhTi9WZNg5LeJWOaGHwt2YG7p6JahoMVSaqjjoZzvR4g3D
 g/onjc1Nw0p/kw9vgZSsw9tkeKjR8D+gn81Z+z0amyF9B7y7VhWKfHCaw6Fu8wikNojVIVrfwCi
 wiCRmnjjmNQ==
X-Google-Smtp-Source: AGHT+IEwqgIVEVOFIJ9b+98sUXesSJCf/80yebCHpbviEaQ3naGEKHhgRgLlfarDKWQDhITXXiZ1Dg==
X-Received: by 2002:a17:902:ec89:b0:231:b1c8:3591 with SMTP id
 d9443c01a7336-231de36bb99mr23502505ad.24.1747383121009; 
 Fri, 16 May 2025 01:12:01 -0700 (PDT)
Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com.
 [76.94.249.45]) by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-231d4ebb9f6sm9377095ad.207.2025.05.16.01.12.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 16 May 2025 01:12:00 -0700 (PDT)
From: Xiyue Deng <manphiz@HIDDEN>
To: Anush V <j@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87msbdxyv0.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
 <87msbdxyv0.fsf@HIDDEN>
User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1
 (x86_64-pc-linux-gnu)
Date: Fri, 16 May 2025 01:11:59 -0700
Message-ID: <87ldqx3rg0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: Robert Pluim <rpluim@HIDDEN>, 78366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Anush,

Anush V <j@HIDDEN> writes:

>> From: Xiyue Deng <manphiz@HIDDEN>
>> Date: Thu, 15 May 2025 00:17:02 -0700
>>
>> Anush, can you try enable auth-source-xoauth2-plugin and eval `(setq
>> smtp-auth-supported '(cram-md5 plain login xoauth2))' and see if
>> this helps?
>
>
> `(setq smtp-auth-supported '(cram-md5 plain login xoauth2))' didn=E2=80=
=99t
> work.

It was a typo, sorry.

> You probably meant `(setq smtpmail-auth-supported '(cram-md5
> plain login xoauth2))' and it worked.  Able to send email from both
> the accounts.
>

And thanks for confirming.  I'll update my plugin soon.

> --
> Regards,
> Anush

=2D-=20
Regards,
Xiyue Deng

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmgm808SHG1hbnBoaXpA
Z21haWwuY29tAAoJEC3pZe1jglyT2JYQAKTWU43RpFnR9DpVbW3CTJ1ZifWFw16Q
63Bty1xBv9/xnIgfhT0KuxoTXXM3O5PCIUPpP11kmhzIQ1nGdmbneY2BgKwISHt2
8gY5P43QsWyHE/g0XDwnmH8K1fMjrH+i5PXijAfUQIfAfQojs9CGICKISAp7LvEI
nLSaSWdx1H1qKYgcsEWo0F7PV1EBN0h1Ch+l/8DRGCqUZWqauu5esUNYx5WE3FYe
3jnYvT9ISjvOeDWvF1z5gQH1z4Ifb3ICTLmfc7y3UY4bNpzZLcJqB/cfkWM9Iqi1
9RXSixdkgfUeaoSG0/kg8Wghgt83BMnO90CxdXKxr2RMyGkY0XriaMs7bEcN0Ut0
5xEDujmwqGyDFpxdTk0ALczs/YpzbrnwrcR7cDAKpbCpfB+nR1/4rsgmhi+gzhUu
Tkphyt+dV3ZR8LmIik/uXZh3kd6biCscX7qN0uAB9pU6oBMQEz77ev4vhK3ZCx1P
wOGu3SkvE3l0GqhUPdZyizkKpJ2WBz2EVApLyYQfFvNAnXRoypSwlJ+71VGmSpIc
rAQyZwaZjvvaus4LIZqgRtvhMwbzwiApUG/JYaYfzlU3voxwrLKvoz5BZcTECztH
bNiWcPARd3P9P5Jph53/xRr4uDWeOEG4zAS4w20VYzzrOoAE50V6NiKWXLAA1+Yd
EmPDBRdb8F+I
=Nodh
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 16 May 2025 08:11:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 16 04:11:57 2025
Received: from localhost ([127.0.0.1]:33888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFqAe-0006CN-US
	for submit <at> debbugs.gnu.org; Fri, 16 May 2025 04:11:57 -0400
Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:56741)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <manphiz@HIDDEN>) id 1uFqAc-0006BJ-Fo
 for 78366 <at> debbugs.gnu.org; Fri, 16 May 2025 04:11:55 -0400
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-22e6344326dso19705475ad.1
 for <78366 <at> debbugs.gnu.org>; Fri, 16 May 2025 01:11:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747383108; x=1747987908; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=XNwIOnxmdiWFfpBB6iHIhojbxOrDAfol0aOTuBg0700=;
 b=EeosGtSChjUYIo0o38PF+aBq3oB8irXrFDqrBB4CyPXUODUcTHkXfXjTflezF87IJo
 1h6DI59FCqiCi5NKYUa8VR7E7kqCxJZg7Tjex42sAOhay76yth2rj3DPzlW/SRzTmFPz
 XJA3CeANpQVUyLX01odM2zR0uFCtFjYTbbtN2mJfOgQCekzANjpuGkuY4bXI4Utu+Dqe
 SC8xxLdqwbdW70of5YH0LbEG9Kk/cHZzN00IIq8PNCU0FkmeIX/vYwDmw8xibJXasBfA
 +rVmJFrQGVkJS8np+1MO6ED4dBrB6glscKmdAdnjC6vEdbkmTJ2VsEzLdPwDjkQgPIyU
 ULlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747383108; x=1747987908;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=XNwIOnxmdiWFfpBB6iHIhojbxOrDAfol0aOTuBg0700=;
 b=na/F5/BlCumh5jBHnS/rBASz4a6RGKqeYJavEqc/VbFdu9qO0IkBMpOdiQbo7bvxKZ
 CfkOJNAdnDv7n8xpv7SEiMON71oSxmov+qNJalXvZV4ionS+C6QGrO90cnHVsESQZsrl
 D/5avFIoRyDuh8MOdtO1qJQ7/ESG32hxCxNb6bKywYL408IbwjXH/BSHod/D/AVytqCz
 izMiWJGX1uG0A54NnMVbvi6MjrLjFLvD3b5xogwcfmhUsdtBQYCegVoMhQJRxQopGB7b
 dVp6I9uQzCkecmfUTwxYtISf+k9+kiro4v+WSnVkP/440/SsZd9YCEp+tzOmF+VUpsbe
 /Ssw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUEqz5Y2UT44cTg50EkkaWqbjFv5+ol8ZYc5iAPLUsmakwpOVKmH9UhxrRgFlavYqNhCOUGrA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yz0PfHupD23jYpx3h/OByo+FK7EqRE47JhXIwy4KiTuJo0+KLZN
 +MkxhdfOAHZ8FL80/a0cCfKfDzzJ3DSEy10sKsR4LvCN+O7icsfOLOOAMYNF7Q==
X-Gm-Gg: ASbGncsSFyzluh5v93xxnat32tVO29fb7HzY+92zsSHUs1j45wRxPSpufZ4RY4NR7gz
 fzncw+3aoV9IzqH7mGZ7SXHGKMp6Ltp80JfSzPLbs44G5+pQoHDCyKHQqEVsrTKLOPQtVn8/UAQ
 X2Vo3OQpSlkBiH7r4gvNeWDQuwcCHeEzBp0k8GWzvpnxRnZA99n92x9DuGeKS1Z9Kjj1I7pjl+c
 H94bv5JiQOfmM/m4vZUToc92C8rHoIXPUjRDypN2FXLoVdz02K7Xg+S5hhWBf9MAljajbaYOI8q
 469UuZT3iUDhLdfHmT/Fi/BSwjSshJL6HkX6fISaQrplEp4A3sHhllvh2kHwBavZuLo1qqeR0lu
 woYmVFrpkEL2Jc/SCeNOT
X-Google-Smtp-Source: AGHT+IFRWp5Vyq5DT3MWoVuFFhjk6bMgTvHTyJRK+f0ycMq8k6Pvr8I4wiZ5+VECRrAG4gfmb+msGQ==
X-Received: by 2002:a17:903:178e:b0:223:3b76:4e22 with SMTP id
 d9443c01a7336-231d43d54e3mr24277005ad.6.1747383107809; 
 Fri, 16 May 2025 01:11:47 -0700 (PDT)
Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com.
 [76.94.249.45]) by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-231d4adbfe1sm9420985ad.66.2025.05.16.01.11.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 16 May 2025 01:11:47 -0700 (PDT)
From: Xiyue Deng <manphiz@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87r00qky5p.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
 <87r00qky5p.fsf@HIDDEN>
User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1
 (x86_64-pc-linux-gnu)
Date: Fri, 16 May 2025 01:11:44 -0700
Message-ID: <87msbd3rgf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Robert,

Robert Pluim <rpluim@HIDDEN> writes:

>>>>>> On Thu, 15 May 2025 00:17:02 -0700, Xiyue Deng <manphiz@HIDDEN> s=
aid:
>
>     Xiyue> Thanks for the insights! I managed to reproduce the issue, and=
 during
>     Xiyue> debugging I got the list from the reply as Anush mentioned.  T=
urned out
>     Xiyue> that the return code was 334 server challenge[1], so it was wa=
iting for
>     Xiyue> the correct user and password.  Sometimes this was directly co=
nsidered
>     Xiyue> authentication unsuccessful for Gmail[2].  `smtpmail-ok-p' con=
siders a
>     Xiyue> return code less than 400 as successful, and only has challeng=
e handling
>     Xiyue> implemented in cram-md5.  As we should be providing the correct
>     Xiyue> credentials directly in xoauth2, 334 is effectively a failure.
>
>     Xiyue> Maybe in `smtpmail-try-auth-method' for xoauth2, if we see ret=
urn code
>     Xiyue> 334, we should change the return value to "535 5.7.8 Authentic=
ation
>     Xiyue> credentials invalid".  Would like to see whether the Emacs mai=
ntainers
>     Xiyue> this is a good idea.
>
> It=CA=BCs either that, or change `smtpmail-ok-p' to accept a second
> optional parameter for which codes to accept for success, which seems
> like overkill here.
>

In this case it's more like which codes not to accept (334), but I agree
`smtpmail-ok-p' is probably the wrong place to handle that.

I'll work on a patch for `smtpmail-try-auth-method' later.

> I=CA=BCm confused as to why Gmail is returning 334 here, if as you say the
> credentials should be correct. Would answering the challenge help?
>

Oh I wasn't clear.  Actually in this case the credentials provided
through xoauth2 is incorrect - the password set should be the access
token but instead it was the app password.  Gmail handles this by
returning 334 and waiting for the correct access token instead of
directly failing with 535.  I'm not sure why Gmail does this.  Probably
it's more tolerant if a user is using xoauth2.

>     Xiyue> Meanwhile, a workaround for auth-source-xoauth2-plugin is to p=
ut xoauth2
>     Xiyue> as the last entry in `smtpmail-auth-supported'.  Anush, can yo=
u try
>     Xiyue> enable auth-source-xoauth2-plugin and eval `(setq smtp-auth-su=
pported
>     Xiyue> '(cram-md5 plain login xoauth2))' and see if this helps?
>
> If this fixes the issue, you could put this workaround in your xoauth2
> package.
>

This works in my local test, and I think Anush also confirmed it worked.
I'll update my plugin soon.

> Robert
> --=20

=2D-=20
Regards,
Xiyue Deng

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmgm80ASHG1hbnBoaXpA
Z21haWwuY29tAAoJEC3pZe1jglyT2CAQAIbR1FI2vRzb/FyWnwEhM/rPQqI9TPlW
nT/aOcaFjbO1yPZrkVasOixVfiSGSCYmzFphjgJd8WifYsvlCe6bhpwnyNOy5wzu
W5nbwjd8ePLPHUBMQbxEHXy3nWXdcE9alBjc+KwGHRZpT4sldqkwrYIxVZFY3XfG
31zoBNqsDbH8L8N8baUX/bbjzdYgpeRG0vvTHaOfEyvrefmDd0ihgoAjGohST+Bx
E7fWNrRYIb+OuO7qaYGcPxDEnPdfiXv8ZiHIgXExV/mgOh9e+9AgrrGizNS1Zd/U
jtyiZnCDi6wkndacJN8oCIlLZFYt03eIuDPVMtNI9LARd1CbpOpw7gECcjXKUohO
tSersabJXnEKt9bptdMsL/JhcYg0jGsl0FYwkb0V0Th/vqxXcxuFSub9Cs9nufaz
INPLmCYVau6e1zWJjdA52St4tj7g2ZAn40QKRgr8akivrsg4PolgtAaNptmhd+4k
obEoYIpN9ueQpkfX61fLWodNNA+hg5pJUPhuq9c8i04SxFhBvjdI3h368j0KAAAV
/50dDggEleXZseMcdLZvhZiX7rsHZMz99UCBmo8JJAGG0+MPqvL8FZ+YuB9djb96
xFne1Ztxf1PNvrf/MUpCSoBeGsYip/Cipa0shx/CvMuBLapPNDJeNlNf5E+KHgck
61qKeHluOiAN
=CfRO
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 15 May 2025 23:01:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 15 19:01:47 2025
Received: from localhost ([127.0.0.1]:57581 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFhaF-0006Ym-8x
	for submit <at> debbugs.gnu.org; Thu, 15 May 2025 19:01:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48232)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <j@HIDDEN>) id 1uFhaB-0006YG-Px
 for 78366 <at> debbugs.gnu.org; Thu, 15 May 2025 19:01:44 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <j@HIDDEN>)
 id 1uFha6-0004Ky-DM; Thu, 15 May 2025 19:01:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:References:Date:In-Reply-To:Subject:To:
 From; bh=SZLiqNYVCidb7GIYhvTzsOg7DWrW//1wImBa7rQbyuY=; b=VmdfmcXWiX8QlsSYi6nf
 +BYy8ZGZhOAP+15xbGgh+7nlyGqBycdMBuiljX4gG2A5BKzxWLY9ZXPwDVYPmGr0AN0UoJ3QcDASh
 a6QsTCEYdXFMfPZ5VUSCxjiYtqTEqmXuGYGUr1SQvHh+1PW5kx2op0bIwJpyIXcz1cMfyhwssR5j8
 GBMA8k+DWEq97EpP7etDL0I2Mo38sT30sBcmMf3Sga4ReklZXGHxor4iT6sYWfucedLkF4o8ak1zE
 aT+Ez48dg2LxEfKySfzcCbIoVwwAiczW6aw3RAmKhEtZdrz/O+MIc65j4vu9o4uKio7T7OpTPwzsy
 PL7ngg5TdaiWWQ==;
From: Anush V <j@HIDDEN>
To: Xiyue Deng <manphiz@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87v7q24a35.fsf@HIDDEN> (Xiyue Deng's message of "Thu,
 15 May 2025 00:17:02 -0700")
Date: Thu, 15 May 2025 19:01:23 -0400
Message-ID: <87msbdxyv0.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78366
Cc: Robert Pluim <rpluim@HIDDEN>, 78366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Xiyue Deng <manphiz@HIDDEN>
> Date: Thu, 15 May 2025 00:17:02 -0700
>
> Anush, can you try enable auth-source-xoauth2-plugin and eval `(setq
> smtp-auth-supported '(cram-md5 plain login xoauth2))' and see if
> this helps?


`(setq smtp-auth-supported '(cram-md5 plain login xoauth2))' didn=E2=80=99t
work.  You probably meant `(setq smtpmail-auth-supported '(cram-md5
plain login xoauth2))' and it worked.  Able to send email from both
the accounts.

--
Regards,
Anush




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 15 May 2025 09:42:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 15 05:42:52 2025
Received: from localhost ([127.0.0.1]:51134 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFV75-00013b-Sg
	for submit <at> debbugs.gnu.org; Thu, 15 May 2025 05:42:52 -0400
Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:49383)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1uFV73-00013H-JK
 for 78366 <at> debbugs.gnu.org; Thu, 15 May 2025 05:42:50 -0400
Received: by mail-wr1-x42c.google.com with SMTP id
 ffacd0b85a97d-3a1b8e8b2b2so413005f8f.2
 for <78366 <at> debbugs.gnu.org>; Thu, 15 May 2025 02:42:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747302163; x=1747906963; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=37XiW5O8fZdKrmuQpH70w9XbLq+9VqieTfYjlpqv4Xs=;
 b=V+z+gZ6C2iPR+4x12gPXeOdRowWC7KYZVXygAj7tsUWtZi6C0MAvbfThf45e8KFqJq
 rVQD5Ofoup8aYzOAhzQ6vvE14w26dbJFoKL/qNf85CrepNzsMMyO+AdFs6rEOrrb7wnC
 jIjn2yFbWi7RIbfgFpAdu/moGBk6m4BOUr9ZOhllhXXEVbcfhWcDInShZYv6x9SMEuNT
 9pgqVTQhxWCyJPH8hUc9K3+RJU9OrtJ2327E0UNoSma/dWws6YAHE94ocZ6or6SJzvqT
 8OYZh4Ht3GRYBO0bTY7zZZCicxf5p+Vm1HWlaLJGwaYuGSKPtBVAXlckDltJP6T8OMJF
 3Y5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747302163; x=1747906963;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=37XiW5O8fZdKrmuQpH70w9XbLq+9VqieTfYjlpqv4Xs=;
 b=sz2GVMcJ/cFG8qypYoJVHUHR6Cav7s403Hs4b2o9UyejvavvbBeWXGqhF6u8YWhm4l
 2DdKL926WpXPUdpOg6XUofFk9yyY9ZYpx9W2vr+KACSlvnTp1GIg7xCiCbpmkQRX0Cap
 IAaFtwuimSwf6mkTIKHdBUgBx4/9tM3TO+r76LWVicnIiAmYoeZyg9l1Z8go++juQurs
 +4ryE0FyuB3SSI93hm52Ow04y0ABsET9DzaaN56ZfOCEcMhLrYQpv1qN9i23OhMfBcWt
 ImsT3zQ3GKiZQSfNGhTIIa9ADsxSyYh6JpXNUpxCo+ikYFHZmgkjh8PayYKOHabRLGN0
 IveQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCXjbOequsyJKGT5lN1Wk2hIInqZw935UIP1GtaVSnKvncuXcLC7UFcF0rHIcN+/0OgJhzPgsw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwwbugiZsudAMFzP+FzAx+nSxNrFu+erOukL3b0/UbbJ5lSA+Tc
 fZZ0UzHHVP2JdzdydUEDp2MpwKXbRNxhP+yXZQYJdEw4WlVlUdOxsV8fd1G3
X-Gm-Gg: ASbGncs5BY1enW7R3y1Txjcl9+Clom826VFhPr8UDoYs8B47oUYYCbem2+qQQa57K3o
 whZv5dkaRk2H1AMymGbW/d7tO8JSFE18UM7q8E2kr/wu/9PTAZIws4Gbfn9ybgno+P/ZYFNQlMF
 Dj0P9OKi4camWyCK5B/P6mjTA8izBEXiDibEV07XwXGKWt5O78kOw9v/Xh49dlGeoNCxMO3AlNY
 V6JwCX7QP13usDj7cmemwa2PZRN+ETRVV4haphwhUXYBQ2ANNoEbdJlZ+/TMuHB3G+X4gozdODF
 Y2KvPCe75QTJ+0WSRB7L93gtoKjKBewMB8f3Xfk=
X-Google-Smtp-Source: AGHT+IFJzdQELG4ItC9ds7PIao21cQMT+OmJSxJ/I50Youzj1EsESTjfGx2wfcEmZ12MhOjaoFzgkg==
X-Received: by 2002:a05:6000:2385:b0:3a3:5918:bb9e with SMTP id
 ffacd0b85a97d-3a35918bc1bmr1012923f8f.59.1747302163002; 
 Thu, 15 May 2025 02:42:43 -0700 (PDT)
Received: from rltb ([2a01:e0a:3f3:fb51:5518:2649:97c2:bed8])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-442f337db24sm59810275e9.15.2025.05.15.02.42.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 May 2025 02:42:42 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Xiyue Deng <manphiz@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87v7q24a35.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN> <87v7q24a35.fsf@HIDDEN>
Date: Thu, 15 May 2025 11:42:42 +0200
Message-ID: <87r00qky5p.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Thu, 15 May 2025 00:17:02 -0700, Xiyue Deng <manphiz@HIDDEN> sa=
id:

    Xiyue> Thanks for the insights! I managed to reproduce the issue, and d=
uring
    Xiyue> debugging I got the list from the reply as Anush mentioned.  Tur=
ned out
    Xiyue> that the return code was 334 server challenge[1], so it was wait=
ing for
    Xiyue> the correct user and password.  Sometimes this was directly cons=
idered
    Xiyue> authentication unsuccessful for Gmail[2].  `smtpmail-ok-p' consi=
ders a
    Xiyue> return code less than 400 as successful, and only has challenge =
handling
    Xiyue> implemented in cram-md5.  As we should be providing the correct
    Xiyue> credentials directly in xoauth2, 334 is effectively a failure.

    Xiyue> Maybe in `smtpmail-try-auth-method' for xoauth2, if we see retur=
n code
    Xiyue> 334, we should change the return value to "535 5.7.8 Authenticat=
ion
    Xiyue> credentials invalid".  Would like to see whether the Emacs maint=
ainers
    Xiyue> this is a good idea.

It=CA=BCs either that, or change `smtpmail-ok-p' to accept a second
optional parameter for which codes to accept for success, which seems
like overkill here.

I=CA=BCm confused as to why Gmail is returning 334 here, if as you say the
credentials should be correct. Would answering the challenge help?

    Xiyue> Meanwhile, a workaround for auth-source-xoauth2-plugin is to put=
 xoauth2
    Xiyue> as the last entry in `smtpmail-auth-supported'.  Anush, can you =
try
    Xiyue> enable auth-source-xoauth2-plugin and eval `(setq smtp-auth-supp=
orted
    Xiyue> '(cram-md5 plain login xoauth2))' and see if this helps?

If this fixes the issue, you could put this workaround in your xoauth2
package.

Robert
--=20




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 15 May 2025 07:17:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 15 03:17:18 2025
Received: from localhost ([127.0.0.1]:50480 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFSqD-0001q2-Us
	for submit <at> debbugs.gnu.org; Thu, 15 May 2025 03:17:18 -0400
Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:47217)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <manphiz@HIDDEN>) id 1uFSq9-0001pm-Cl
 for 78366 <at> debbugs.gnu.org; Thu, 15 May 2025 03:17:14 -0400
Received: by mail-pf1-x436.google.com with SMTP id
 d2e1a72fcca58-74248a3359fso619731b3a.2
 for <78366 <at> debbugs.gnu.org>; Thu, 15 May 2025 00:17:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747293427; x=1747898227; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=pYHiTGEK+0Iw8CjQuWgepj8MnUDqyCvMHWzcyRqTvy0=;
 b=MrmrzKNnLH8tbZ5nIUH+NjYA3/7nsUO1larpF7agS33zEsuKfm5TBAr1LbR2X70S0r
 U4GxJv02mDgTMqgNRVjAGNUtVuA0vefdHjmSnoSd+X0Vd6DKa02gITazVh3kPOBBa0ji
 9DLRSZkPC3Wa7ehj6eEWJ7K83aLFEf2JyX14dLtLbToxLjZn/1xmzl3sGvirjMpd1zN4
 BwD8PjG8cxKPRLFu0B0xk0senOuakkd8T3dOjmpZoM28ny/sJwEkFpDfAr8tuwAcLwXy
 1W41ta2l0AHM2ccMK2WnknSpSaq080IKMgOSorxxV1B0pMm7wnxBcAn2FQiT/CcyfnwA
 Q0QQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747293427; x=1747898227;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=pYHiTGEK+0Iw8CjQuWgepj8MnUDqyCvMHWzcyRqTvy0=;
 b=Ls1NOPnvlcgt7WK2+zVwvbGd1OeyiUIdtQAk1GQMW0B+4l/Yq73lvIQszpaXnOYlVf
 RTUMQCxYEwIC78TNAOqrWX1nCh6XJwquq2E2fOBMc5HgjTS878ewD3Gav8w833MMWGuB
 xlBgUgifc7rglFisc4GnvvnuxWXtV1KCcpZSohNWIKIRsh0EuKIEsqZNsP78nn0dNoPZ
 nHfVdGDj+9DhZF4f3KpWUmW96hjS9B7z+OEwtfkySqoaA6hoYWjhLZine7hST7U+bJ8i
 LocNKHoonb+wEPSVdUhOU9XC8kU9YEYzQcDHt67KgmuKqMSHoMw41oSMAmEWUl8x+gMI
 8Kjg==
X-Forwarded-Encrypted: i=1;
 AJvYcCW0KsU/TIVc5BPQct0oLeiMohIHwj45Yod/rijir9K1oSZXHCGmbBw1oMwsY8ev6AncbWfxiw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yy0+yaR7WGUR9zuX5uY5SlouWUY1+kAGgfkrgK1e+xpR7XAa4hK
 jTtPGZg+QZDREK939avtuTjjtkclm4mkkrK8RXy0O2c1klurJEKYhoQP+Q==
X-Gm-Gg: ASbGncuTeKRtMIuQHXgfKUxtF9ueuxqCLdGxQrzVo/XbRwBZp0IZ07zs50Tv0tSoTyJ
 RxtkyaNtPogQT90Ac3K0myU93N0yiDpIK+KTrOj6W0UZEXwLUAAfwmELeaIcZnh2uXih+NS3HeI
 iL0/PU0XIK0s6j8CtItgww0vuYtaQMPSP39e4Mc5RqTtsB7x/AGOM8OCOL1L1k/9862rixzAjmo
 RJ20kyqDUL+DbI5kqFNBoCMy4MiVzSRPDbYT9tDgy3X9qFZifoZ50kVC1elq6E/PvIZTuLtDzkU
 JKt6Gzj6kzqlQUFszYJcB0eUPMvdu2Hxx7482243g1f+cr80TT8vpVxi0Z21xzTro3g0z3T7gQQ
 K8R2Np/qQoQ==
X-Google-Smtp-Source: AGHT+IFfdIDLMTuzfN5/wSboQlPfB6thUTQNYt4P93BZRht4WbfZrKlv8TDbX3ZW+9gviNhuFYxo1w==
X-Received: by 2002:a05:6a21:6d97:b0:215:df3d:d56 with SMTP id
 adf61e73a8af0-215ff10113cmr9515741637.21.1747293426556; 
 Thu, 15 May 2025 00:17:06 -0700 (PDT)
Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com.
 [76.94.249.45]) by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-7423772757esm10637119b3a.37.2025.05.15.00.17.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 May 2025 00:17:05 -0700 (PDT)
From: Xiyue Deng <manphiz@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <874ixnmk4y.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
 <874ixnmk4y.fsf@HIDDEN>
User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1
 (x86_64-pc-linux-gnu)
Date: Thu, 15 May 2025 00:17:02 -0700
Message-ID: <87v7q24a35.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Robert,

Robert Pluim <rpluim@HIDDEN> writes:

>>>>>> On Tue, 13 May 2025 09:55:24 -0700, Xiyue Deng <manphiz@HIDDEN> s=
aid:
>     >>=20
>     >>=20
>     >> I did some debugging.  According to comment =E2=80=9C;; A string r=
esult is an
>     >> error.=E2=80=9D in the function smtpmail-try-auth-methods, the fun=
ction call
>     >> (smtpmail-try-auth-method process 'xoauth2 "user" "password") shou=
ld
>     >> return a string when authentication fails.  However, it currently
>     >> returns a list instead, which prevents other authentication methods
>     >> from being tried.
>     >>=20
>     >> [...]
>
>     Xiyue> Thanks for the investigation! If the try-method don't fallback=
 to the
>     Xiyue> other supported auth methods then it will break.  I tried to r=
ead the
>     Xiyue> code of `smtpmail-try-auth-method' for xoauth2[1], and besides=
 lacking
>     Xiyue> encoding user and password into utf-8, I don't see anything ob=
viously
>     Xiyue> different from plain[2] and not sure why it would return a lis=
t.
>
> utf-8 encoding is not necessary for xoauth2, see commit
> 745847ba8eca27e981a50ad91b628bbce35bb0f3
>
>     Xiyue> Would be great if any Emacs developer can shed some light here.
>
> `smtpmail-try-auth-method' will call `smtpmail-command-or-throw
> process', which will return a list upon success, and string upon
> failure. That decision is made by `smtpmail-ok-p', so that=CA=BCs the
> function you should check. Setting `smtpmail-debug-info' to t will get
> you a trace buffer of the SMTP commands, that should help.
>
> Robert
> --=20

Thanks for the insights! I managed to reproduce the issue, and during
debugging I got the list from the reply as Anush mentioned.  Turned out
that the return code was 334 server challenge[1], so it was waiting for
the correct user and password.  Sometimes this was directly considered
authentication unsuccessful for Gmail[2].  `smtpmail-ok-p' considers a
return code less than 400 as successful, and only has challenge handling
implemented in cram-md5.  As we should be providing the correct
credentials directly in xoauth2, 334 is effectively a failure.

Maybe in `smtpmail-try-auth-method' for xoauth2, if we see return code
334, we should change the return value to "535 5.7.8 Authentication
credentials invalid".  Would like to see whether the Emacs maintainers
this is a good idea.

Meanwhile, a workaround for auth-source-xoauth2-plugin is to put xoauth2
as the last entry in `smtpmail-auth-supported'.  Anush, can you try
enable auth-source-xoauth2-plugin and eval `(setq smtp-auth-supported
'(cram-md5 plain login xoauth2))' and see if this helps?

[1] https://en.wikipedia.org/wiki/List_of_SMTP_server_return_codes#%E2%80%9=
4_3yz_Positive_intermediate
[2] https://support.google.com/mail/thread/204884242/334-authentication-uns=
uccessful?hl=3Den=20
[3] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/mail/smtpmail.el#=
n662

=2D-=20
Regards,
Xiyue Deng

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmgllO4SHG1hbnBoaXpA
Z21haWwuY29tAAoJEC3pZe1jglyT8lEP/Arz9cBG9iswXTUHXAcpCrtNORhG38Sy
yRXPDD58ZhzZuKSKdhWFX/Hm3GTPick6DxQYjrRFC4FUSX9emFhsSuIrwNlL8KMT
u+liOYW0MyOh2gLLIxALY8M2F8Dnbe/p19TsW+wK5t7ujhmrkpngl2A/OVeyMhsM
dXTBHS+R3Rzvp7mPtp7x06Ji5yyPDjIXoc4rIW2lpRr8y2Jvx0lsFgA5k7NzQ5gL
8im3ORjlKpwTvPr9tMx/FEGw9W6WadbWv4UVKgnJXFYk/yt0CIFtN+4k16OwlFoE
52p5q21hLNI9AIJNpLbXc9pkAoosCaPJ8tQZNUsolVd3f7hFRIKIYY+RKBEAFMey
16MlOCgF8PvEV2xbji4iHTs6tnmQf137lFuLTwsUFpzEl+Pv9RvlYIwi7HfMboLQ
ZRyglQrGSdq5tMj2Wi1/7f2AYk0VSV+kFuF5cSPmXninNIctP6gNVV0KWN2PleLx
3rMZULXAP8tYZPgVuZ8NVkL2+XADMLvO2FCTDCn3EAXi0qKfzsAx+5e7H/N2Duuc
JqHKHz6jILnySVc0HkQ1oibhQFs/HvzXxWz6FY9puY7lmtmCU0qXW2Lgvcfazsar
BR8BmBEJ0+74zElvNn0Xir777ss8FQrsH03pjORGeFmkeyhUXu7PQNRC7PeUhGoZ
JU+h1U0aGScs
=fmek
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 14 May 2025 12:50:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 14 08:50:36 2025
Received: from localhost ([127.0.0.1]:41257 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uFBZD-0007vD-8Y
	for submit <at> debbugs.gnu.org; Wed, 14 May 2025 08:50:36 -0400
Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:49249)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1uFBZ6-0007tZ-Mm
 for 78366 <at> debbugs.gnu.org; Wed, 14 May 2025 08:50:29 -0400
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-3a1b8e8b2b2so3731617f8f.2
 for <78366 <at> debbugs.gnu.org>; Wed, 14 May 2025 05:50:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747227022; x=1747831822; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=cBUNZqciKHQUqN7UHTuAj7F1F43ynOGgoo2tLvUmBF0=;
 b=Yo8HxOgJFQSa7mxUXlQzRaBdDnilqix7CT060B7K5Ms3KS5+TC23xqyZDdY+lZ1jc/
 A4hE+Xq95jXjcBLShpIaeaqghSahlQd9Ebh0+VROl1o6NC5vufiCz1w45xF15UynCbh/
 1OKbJ/+Xv6tIW/rvjkYNvLGWXyO/89uwiAks1+OkNp8rTkfIzO3p78f6vqsFzIQm8pjk
 F2Ma5c2u9sc4Tktet4xFDWi2FZSsY7uoEDVSZCLrb/I8ST62kHrjALcSVgsexYNO3fyZ
 4mcc96UZ7qdtx9MIcigfw0GD3o1XUkai8SJZDz8BnUS90mkUOmDMvoe82YFi5KIkKMYu
 R+/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747227022; x=1747831822;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=cBUNZqciKHQUqN7UHTuAj7F1F43ynOGgoo2tLvUmBF0=;
 b=LE39XFJKRD5jYqs0dn0PFgCxLX6vc+M2adJvcf3W6fURMRjwcLSs5+6pF0xAxhOV7a
 hEGVpAOqHbyrTTCTdt52Vh/vqbmW6LkETQG8rMpi+ygQbuuFb32AS9vtuO+g+3upTai5
 ZduDiu+zKKzHc7quQFEQ8uV3R4ppahiZSXhExOD4Elvq+tIYEAoWa8lyNWAiNI2fm3o1
 FStM1AbwIgileogI2kMsBkrH+aXX859ipqYBq+ZppgWXqgTu+w0/N1t3BMZrBApePrOr
 4oxuZADpvtSSEXLaqXsdeOnhDFP+iiUTzYVp/yNS5PrBYk7YS9UAS7KOD1U8LegrJtA0
 pVbQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCX+TGdu7ARJu7ZACySwJKYxBcA485RjHr93IPXbzhFk9o4XsFjPvx5wqHl6Uq923li4RVpYiA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzI3PfxovVoulh5qY7fmlpxIdKvGyQYa650o9ol6BCbb0bYSGCD
 /LHtMGBCbJ+nmdgXvqisV5Zk+86nDKnwU3AqjG4kDrZNMJySwQZu9B9FULux
X-Gm-Gg: ASbGncsTnMMi8DUbdYpKSA9U6TiGgfbiItEoa17+NWnFB04Kq4wrbzC0VArvURffwSl
 ANs8qR8r0PojvjWkYHAW+0Y8YhGHhkblZWyuARp4T+CqPZfVEWEBuID88buXkWY6Gl7TZE/s/Xo
 TSBwLlKD0FjRvBymNxT4YQuSeMgTNdOsIPzUuhiyfQWM96hNaNCTtN7U6BJDxKtx/vBEYfNZGxC
 1+8kPFiCzdu4fVhqOSuzvzew+dMbaSsTIiXlMSceApl9dnk99qTPwAtC0aU16URf5GbEnJdH7ZM
 i8jvEUX2s3z8SvwGDquDyeVLV89Vew5XpVoafhN1pOhYk8VX3g==
X-Google-Smtp-Source: AGHT+IEZfEtBVqvZAG1ozEXuy7N7zJ1dayHRii7SzdenxKZGIl7GiQe7i+pZ3usnR/CdeyTBnLg8DQ==
X-Received: by 2002:a05:6000:1786:b0:3a2:244:677f with SMTP id
 ffacd0b85a97d-3a34994fecfmr2380590f8f.54.1747227021960; 
 Wed, 14 May 2025 05:50:21 -0700 (PDT)
Received: from rltb ([2a01:e0a:3f3:fb51:5518:2649:97c2:bed8])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3a1f58f2f65sm19978735f8f.55.2025.05.14.05.50.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 May 2025 05:50:21 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Xiyue Deng <manphiz@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87zffg4fib.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN> <87zffg4fib.fsf@HIDDEN>
Date: Wed, 14 May 2025 14:50:21 +0200
Message-ID: <874ixnmk4y.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org, Anush V <j@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Tue, 13 May 2025 09:55:24 -0700, Xiyue Deng <manphiz@HIDDEN> sa=
id:
    >>=20
    >>=20
    >> I did some debugging.  According to comment =E2=80=9C;; A string res=
ult is an
    >> error.=E2=80=9D in the function smtpmail-try-auth-methods, the funct=
ion call
    >> (smtpmail-try-auth-method process 'xoauth2 "user" "password") should
    >> return a string when authentication fails.  However, it currently
    >> returns a list instead, which prevents other authentication methods
    >> from being tried.
    >>=20
    >> [...]

    Xiyue> Thanks for the investigation! If the try-method don't fallback t=
o the
    Xiyue> other supported auth methods then it will break.  I tried to rea=
d the
    Xiyue> code of `smtpmail-try-auth-method' for xoauth2[1], and besides l=
acking
    Xiyue> encoding user and password into utf-8, I don't see anything obvi=
ously
    Xiyue> different from plain[2] and not sure why it would return a list.

utf-8 encoding is not necessary for xoauth2, see commit
745847ba8eca27e981a50ad91b628bbce35bb0f3

    Xiyue> Would be great if any Emacs developer can shed some light here.

`smtpmail-try-auth-method' will call `smtpmail-command-or-throw
process', which will return a list upon success, and string upon
failure. That decision is made by `smtpmail-ok-p', so that=CA=BCs the
function you should check. Setting `smtpmail-debug-info' to t will get
you a trace buffer of the SMTP commands, that should help.

Robert
--=20




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 13 May 2025 16:55:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 13 12:55:43 2025
Received: from localhost ([127.0.0.1]:32931 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uEsup-0002sZ-2L
	for submit <at> debbugs.gnu.org; Tue, 13 May 2025 12:55:43 -0400
Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:51312)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <manphiz@HIDDEN>) id 1uEsui-0002sG-UL
 for 78366 <at> debbugs.gnu.org; Tue, 13 May 2025 12:55:37 -0400
Received: by mail-pf1-x42e.google.com with SMTP id
 d2e1a72fcca58-7370a2d1981so5096547b3a.2
 for <78366 <at> debbugs.gnu.org>; Tue, 13 May 2025 09:55:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747155326; x=1747760126; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=xI47+RgfjmQ6DLfuUqKMqBv9jUn0m4l2nAdvncMkf/8=;
 b=iHiyF8aAIHw9eQjrSl9v+W3ineYLkc2Yb+/5ieKeHBgAXHorY6dUEXGSI1WC/huutX
 yj2usOCSDi/lDfLsNqarnKNLtuHjnAGQTHqsKtQ+myzuJ28PoM53HeumGKHhCLF1HwW1
 ybZiTsViOyH1PMaZ9KKvwZITe2wnpWrFdDh4VlSj7Ad4mkdeIKd2AfSDwgxb3hDMMTT4
 W1y0lsc3ds0VkQ/ahdGuLg1c3qiAAGoDKoNn6pX6HelD0sevDuwgHBKefYiopu3Mc9pD
 Q17ZCLjr1uF1jiWV8whfEaqxsy5WYmO3bMn3C8DHVzrQ1qcIcjReTAhOtnFCwm18njWK
 z59A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747155326; x=1747760126;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=xI47+RgfjmQ6DLfuUqKMqBv9jUn0m4l2nAdvncMkf/8=;
 b=MtfTmOk5giPO8IHlF3IFNqOZ4i4+BH+BKpLN2jEeWxOV2O6nKtV8bPYwdcB+v/IpMZ
 3MS7POjgey/+eDcQk/FxMoMH1cS6oyz4SbHnEE6glly5GzToj9qpJVpdHGmqxwIccWZI
 PSqxl62vtFXOFLXElLT7Z9cSu5YcB2CzbxBLVMKGIAWULp9zAnIIBMfcY134nWKNv/BW
 VWeI1D636idys8MR/btHec7z1JYioTpddf7xywIkLnam40mFFNOq9waeL0/Q/HYG2gi3
 6zlLlnUUsSR0EQvOX7s/oQb/P1lM7ElyR3gHv0sTKRXOCbkVT+0yf9ExvwMv/6ZTXbzB
 lXaw==
X-Gm-Message-State: AOJu0YyiYTMzE2JwpTemFHSe7jrN6NcC62w1BRbclBowFbx0zseYHHo8
 va+4n2NSsTyVwgn2iel4vpr2p54ls73lspAfYXjZkFgnybe4lPZu1TJY8A==
X-Gm-Gg: ASbGncvbr1Rua/VIN8enzzQQtSqqE3YC6LJ/7aHaiG1mZgE25nrN6sIUueBXBBC/xtx
 Jq+yal3sLyEDNJ+AghntdcJ8HyUhDGp0FyPHoCQqI56LCo7qFHWlfFvJeVKBZIRv4aTeO8Omo2n
 ZYULNKkqDfG9AtTPW+nkJ5Y233GER63T/4Q3PxN3lAQH+lbYZj9Acnlw8QlK87vTn0ClyUFdgJa
 J3nE1SVZMY75WSB9MDILP1rdNiAo1LPjxJFSz6lqUooDTZ3FktF7AsOW0sBJAgFJAgudQqw0UkD
 AR7LjbEQB/qI6ncfnyjz2exTtZnd9nSAbNI01PKUGrv512FNC3taIuaaD2/J7rwYaQJNjZ2+wGi
 nn++VTEaP6A==
X-Google-Smtp-Source: AGHT+IHG1gkN7MfGCPeTf78+Nqk6eRW3lGnlBVGpl5hBNjCF3jTIOuS3bHGxw8UU0muNTDm4ycs9ww==
X-Received: by 2002:a05:6a21:9004:b0:1f5:55b7:1bb2 with SMTP id
 adf61e73a8af0-215ababa2afmr26528413637.6.1747155326086; 
 Tue, 13 May 2025 09:55:26 -0700 (PDT)
Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com.
 [76.94.249.45]) by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-b235198cccdsm7542903a12.64.2025.05.13.09.55.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 May 2025 09:55:25 -0700 (PDT)
From: Xiyue Deng <manphiz@HIDDEN>
To: Anush V <j@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87plgds83p.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
 <87plgds83p.fsf@HIDDEN>
User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1
 (x86_64-pc-linux-gnu)
Date: Tue, 13 May 2025 09:55:24 -0700
Message-ID: <87zffg4fib.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Anush,

Anush V <j@HIDDEN> writes:

>> From: Xiyue Deng <manphiz@HIDDEN>
>> Date: Sat, 10 May 2025 20:36:25 -0700
>>
>> Hi Anush,
>>
>> Anush V <j@HIDDEN> writes:
>>
>>> Hello Emacs maintainers,
>>>
>>> I have two google mail accounts, the first one uses app passwords to
>>> authenticate, and the other uses oauth (because it doesn't support app
>>> passwords)
>>>
>>> When I enable auth-source-xoauth2-plugin-mode, I=E2=80=99m able to send=
 email
>>> from second account without any issues.  But i=E2=80=99m unable to send=
 emails
>>> from the first account.  When I disable auth-source-xoauth2-plugin i=E2=
=80=99m
>>> able to send email from the first account.
>>>
>>> I think that enabling xoauth2 shouldn't interfere with other
>>> authentication methods, so this could be a bug.
>>>
>>> Thank you for your time
>>>
>>> * * *
>>>
>>> In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43,
>>> cairo version 1.18.2)
>>> System Description: Guix System
>>>
>>> Configured using:
>>>  'configure
>>>  CONFIG_SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minima=
l-5.1.16/bin/bash
>>>  SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.1=
6/bin/bash --prefix=3D/gnu/store/lq0nwm8qkj9cmyjm85z3dcqrjnglhcym-emacs-nex=
t-pgtk-30.1-rc1-2.7144e84 --enable-fast-install --with-pgtk --with-cairo --=
with-modules --with-native-compilation=3Daot --disable-build-details'
>>>
>>> --
>>> Regards,
>>> Anush
>>>
>>>
>>
>> Thanks for your report!  Ideally auth-source-xoauth2-plugin should only
>> be in effect when your auth-source entry has "auth" set to "xoauth2".
>> Can you check whether you happen to set that for your auth-source entry
>> for the account using app password?  Sharing your auth-source entries
>> with your personal information removed would be helpful.
>>
>> It would also help to share some of the error logs following instruction
>> in the "Debugging" section in README.org[1].  Please be careful not to
>> share any personal information from the logs.
>>
>> [1]
>> https://gitlab.com/manphiz/auth-source-xoauth2-plugin/-/blob/main/README=
.org?ref_type=3Dheads
>
>
> I did some debugging.  According to comment =E2=80=9C;; A string result i=
s an
> error.=E2=80=9D in the function smtpmail-try-auth-methods, the function c=
all
> (smtpmail-try-auth-method process 'xoauth2 "user" "password") should
> return a string when authentication fails.  However, it currently
> returns a list instead, which prevents other authentication methods
> from being tried.
>
> [...]

Thanks for the investigation! If the try-method don't fallback to the
other supported auth methods then it will break.  I tried to read the
code of `smtpmail-try-auth-method' for xoauth2[1], and besides lacking
encoding user and password into utf-8, I don't see anything obviously
different from plain[2] and not sure why it would return a list.

Would be great if any Emacs developer can shed some light here.

[1] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/mail/smtpmail.el#=
n643
[2] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/mail/smtpmail.el#=
n628

=2D-=20
Regards,
Xiyue Deng

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmgjeXwSHG1hbnBoaXpA
Z21haWwuY29tAAoJEC3pZe1jglyTV+AP/0NKtGS6HM86HU+/SGmBJwmaSe0jiQFX
6Ikwv/s5a8rUd94mESPgXn0VeF0h9KsdEDlbCigi/ZG12GIA/7x3xLrtf5Lpy2gL
jSXmc+z4JKh0oFcDW0wYFyMUUy1ZuVMy4D86xB8xMl5KGr6rnBTOEtEQ/gS+h1Ax
tlMYIzAKEx8k2MqfRB0oBElg+lEJk8hJ/dRc6+/82CWGmjCTw6BQjvrpblsJfGxL
FpHpGAznB1a4oIb4v3zqWaPA+JmEodoj0JnMLbFyyR3pADIqhADqPzDYgVEl+fv5
JTr9YehuFO/y9psCvtnBCR4LQY9gWuFlFNpTVvk/V7KNPvy3UDBShpKDbLBuSU19
0XZa/GzeiMJHDaJ+SPV3NNpew1VVADDFZ2i+nXSToKtHShTSDEaiC1OFp4BDCjYs
cZuO355dh5NnNKmGxVW7SGnz0+b+W3dG5Ho4UlYoU4QQVCd15Uv1kSs2NyIHl1LJ
bSIiSoLtSeipGfy+sJ3bZyMqBOLssFw2XSDwudQh+csSlKpHccnTAFol4NHsQVAX
PZQWJR84iSt75jqL9Dno6ZmcMrIHK0RTol2w6eB3lL7kAqAowwipHAVgPmJrFOKn
yzXiDrZeqbAEtXY9T9wwb0+WMQHWjW28d0jdYr94naLwVXgn1iM+IDPgByiBkgjc
3+B6n8SRDERu
=Xj39
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 12 May 2025 23:50:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 12 19:50:12 2025
Received: from localhost ([127.0.0.1]:55882 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uEcuN-0001jt-TV
	for submit <at> debbugs.gnu.org; Mon, 12 May 2025 19:50:11 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48426)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <j@HIDDEN>) id 1uEcuH-0001ga-JN
 for 78366 <at> debbugs.gnu.org; Mon, 12 May 2025 19:50:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <j@HIDDEN>)
 id 1uEcuC-00089t-7z; Mon, 12 May 2025 19:49:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:References:Date:In-Reply-To:Subject:To:
 From; bh=CAEBBMAMQwJSOIkEALFtc2j9gbhy6N5vnfTWHZZW4mI=; b=WRk9htbMwA5BTTAUE9bx
 aUy2GSqprnaxvnqwaoWG7CaHrN8uZrGyt3Z7KxiBE3b9vWP76Ri/h+lZ6ecsIOu33k2ImMcRCLN1v
 mFXuhM2AputaGNPFoW/NoOySt2j6UgUJBKiZVSFcX+3iVTmmEyGjFMtRM7Yw5cRPlXJUwEfxHATOL
 dCVG6d75PEawIbl6DRAUxllXP4QwqZeKLxKpD848DYg19SF2L4XnoAfmhXy7nA73wEzNnhjqnDD8f
 3XiSHoA67UktIM9YL2yDUaAIBZQ7aiH9L5GAeT/jrIBP8MV8US9veKPUogoSkjGGulI1RTtBVcru+
 roNo40CbZZ7UWA==;
From: Anush V <j@HIDDEN>
To: Xiyue Deng <manphiz@HIDDEN>
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87msbj6cp2.fsf@HIDDEN> (Xiyue Deng's message of "Sat,
 10 May 2025 20:36:25 -0700")
Date: Mon, 12 May 2025 19:49:14 -0400
Message-ID: <87plgds83p.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN> <87msbj6cp2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78366
Cc: 78366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Xiyue Deng <manphiz@HIDDEN>
> Date: Sat, 10 May 2025 20:36:25 -0700
>
> Hi Anush,
>
> Anush V <j@HIDDEN> writes:
>
>> Hello Emacs maintainers,
>>
>> I have two google mail accounts, the first one uses app passwords to
>> authenticate, and the other uses oauth (because it doesn't support app
>> passwords)
>>
>> When I enable auth-source-xoauth2-plugin-mode, I=E2=80=99m able to send =
email
>> from second account without any issues.  But i=E2=80=99m unable to send =
emails
>> from the first account.  When I disable auth-source-xoauth2-plugin i=E2=
=80=99m
>> able to send email from the first account.
>>
>> I think that enabling xoauth2 shouldn't interfere with other
>> authentication methods, so this could be a bug.
>>
>> Thank you for your time
>>
>> * * *
>>
>> In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43,
>> cairo version 1.18.2)
>> System Description: Guix System
>>
>> Configured using:
>>  'configure
>>  CONFIG_SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal=
-5.1.16/bin/bash
>>  SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16=
/bin/bash --prefix=3D/gnu/store/lq0nwm8qkj9cmyjm85z3dcqrjnglhcym-emacs-next=
-pgtk-30.1-rc1-2.7144e84 --enable-fast-install --with-pgtk --with-cairo --w=
ith-modules --with-native-compilation=3Daot --disable-build-details'
>>
>> --
>> Regards,
>> Anush
>>
>>
>
> Thanks for your report!  Ideally auth-source-xoauth2-plugin should only
> be in effect when your auth-source entry has "auth" set to "xoauth2".
> Can you check whether you happen to set that for your auth-source entry
> for the account using app password?  Sharing your auth-source entries
> with your personal information removed would be helpful.
>
> It would also help to share some of the error logs following instruction
> in the "Debugging" section in README.org[1].  Please be careful not to
> share any personal information from the logs.
>
> [1]
> https://gitlab.com/manphiz/auth-source-xoauth2-plugin/-/blob/main/README.=
org?ref_type=3Dheads


I did some debugging.  According to comment =E2=80=9C;; A string result is =
an
error.=E2=80=9D in the function smtpmail-try-auth-methods, the function call
(smtpmail-try-auth-method process 'xoauth2 "user" "password") should
return a string when authentication fails.  However, it currently
returns a list instead, which prevents other authentication methods
from being tried.

As requested,

auth source entries.

     # for first account (app password authentication)
     machine imap.gmail.com login <first_email> port 993 password <app pass=
word>
     machine smtp.gmail.com login <first_email> port 587 password <app pass=
word>

     # second account (xoauth2 authentication)
     machine imap.gmail.com user <second_email> port 993 auth xoauth2 auth-=
url https://accounts.google.com/o/oauth2/auth token-url https://accounts.go=
ogle.com/o/oauth2/token client-id <client_id> client-secret <client_secret>=
 redirect-uri http://localhost scope https://mail.google.com
     machine smtp.gmail.com user <second_email> port 587 auth xoauth2 auth-=
url https://accounts.google.com/o/oauth2/auth token-url https://accounts.go=
ogle.com/o/oauth2/token client-id <client_id> client-secret <client_secret>=
 redirect-uri http://localhost scope https://mail.google.com


Logs when I send email from account with app password
(auth-source-xoauth2-plugin-mode enabled):


     Gnus is unplugged; really send queue? (y or n) y
     Sending message 1 of 1...
     Sending via mail...
     auth-source-search: found 4 backends matching (:max 1 :host "smtp.gmai=
l.com" :port "587")
     Advising auth-source-search
     auth-source-netrc-parse: using CACHED file data for <path_to_authinfo.=
gpg>
     auth-source-search-backend: got 1 (max 1) in netrc:<path_to_authinfo.g=
pg> matching (:max 1 :host "smtp.gmail.com" :port "587")
     Matched auth data: (:host "smtp.gmail.com" :user "<second_email>" :por=
t "587" :auth "xoauth2"
            :auth-url "https://accounts.google.com/o/oauth2/auth"
            :token-url "https://accounts.google.com/o/oauth2/token"
            :client-id
            "<client_id>"
            :client-secret "<client_secret>"
            :redirect-uri "http://localhost" :scope
            "https://mail.google.com")

     :auth set to =E2=80=98xoauth2=E2=80=99.  Will get access token.
     Using oauth2 to auth and store token...
     Decrypting <oauth2.plstore>...done
     oauth2 token: #s(oauth2-token
        [#<buffer  plstore
                   <oauth2.plstore>>
                   (("<string1>"
                     :secret-access-token t :secret-refresh-token t
                     :secret-access-response t))
                   nil
                   (("<string1>"
                     :access-token
                     "<string4>"
                     :refresh-token
                     "<string3>"
                     :access-response
                     ((access_token
                       . "<string5>")
                      (expires_in . 3599)
                      (refresh_token
                       . "<string3>")
                      (scope . "https://mail.google.com/")
                      (token_type . "Bearer"))))
                   (("<string1>"
                     :access-token
                     "<string4>"
                     :refresh-token
                     "<string3>"
                     :access-response
                     ((access_token
                       . "<string5>")
                      (expires_in . 3599)
                      (refresh_token
                       . "<string3>")
                      (scope . "https://mail.google.com/")
                      (token_type . "Bearer"))))]
        "<string1>"
        "<client_id>"
        "<client_secret>"
        "<string4>"
        "<string3>"
        "https://accounts.google.com/o/oauth2/token"
        ((access_token
          . "<string5>")
         (expires_in . 3599)
         (refresh_token
          . "<string3>")
         (scope . "https://mail.google.com/") (token_type . "Bearer")))

     Refreshing token...
     Contacting host: accounts.google.com:443
     Saving file <oauth2.plstore>...
     Wrote <oauth2.plstore>
     Refresh successful.
     oauth2 token after refresh: #s(oauth2-token
        [#<buffer  plstore
                   <oauth2.plstore>>
                   (("<string1>"
                     :secret-access-token t :secret-refresh-token t
                     :secret-access-response t))
                   nil
                   (("<string1>"
                     :access-token
                     "<string2>"
                     :refresh-token
                     "<string3>"
                     :access-response
                     ((access_token
                       . "<string5>")
                      (expires_in . 3599)
                      (refresh_token
                       . "<string3>")
                      (scope . "https://mail.google.com/")
                      (token_type . "Bearer"))))
                   (("<string1>"
                     :access-token
                     "<string2>"
                     :refresh-token
                     "<string3>"
                     :access-response
                     ((access_token
                       . "<string5>")
                      (expires_in . 3599)
                      (refresh_token
                       . "<string3>")
                      (scope . "https://mail.google.com/")
                      (token_type . "Bearer"))))]
        "<string1>"
        "<client_id>"
        "<client_secret>"
        "<string2>"
        "<string3>"
        "https://accounts.google.com/o/oauth2/token"
        ((access_token
          . "<string5>")
         (expires_in . 3599)
         (refresh_token
          . "<string3>")
         (scope . "https://mail.google.com/") (token_type . "Bearer")))

     Updating :secret with access-token: <string2>
     Updating auth-source-search results.
     auth-source-search: found 1 results (max 1) matching (:max 1 :host "sm=
tp.gmail.com" :port "587")
     auth-source-search: found 4 backends matching (:host "smtp.gmail.com" =
:port "587" :user "<first_email>" :max 1 :require nil :create nil)
     Advising auth-source-search
     auth-source-netrc-parse: using CACHED file data for <path_to_authinfo.=
gpg>
     auth-source-search-backend: got 1 (max 1) in netrc:<path_to_authinfo.g=
pg> matching (:host "smtp.gmail.com" :port "587" :user "<first_email>" :max=
 1 :require nil :create nil)
     Matched auth data: (:host "smtp.gmail.com" :user "<first_email>" :port=
 "587"
            :secret
            #[0 "<secret1>"
                [(nil)
                 "<string6>"
                 auth-source--deobfuscate]
                3])

     Updating auth-source-search results.
     auth-source-search: found 1 results (max 1) matching (:host "smtp.gmai=
l.com" :port "587" :user "<first_email>" :max 1 :require nil :create nil)
     smtpmail-send-it: Sending failed: 535-5.7.8 Username and Password not =
accepted. For more information, go to
     535 5.7.8  https://support.google.com/mail/?p=3DBadCredentials <string=
6> - gsmtp


Logs when I send email from account with app password
(auth-source-xoauth2-plugin-mode disabled):


     Auth-Source-Xoauth2-Plugin mode disabled
     Gnus is unplugged; really send queue? (y or n) y
     Sending message 1 of 1...
     Sending via mail...
     auth-source-search: found 1 CACHED results matching (:max 1 :host "smt=
p.gmail.com" :port "587")
     auth-source-search: found 1 CACHED results matching (:host "smtp.gmail=
.com" :port "587" :user "<first_email>" :max 1 :require nil :create nil)
     Sending email
     Sending email done
     Sending...done
     No more newsgroups


--
Regards,
Anush




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at 78366 <at> debbugs.gnu.org:


Received: (at 78366) by debbugs.gnu.org; 11 May 2025 03:36:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 10 23:36:46 2025
Received: from localhost ([127.0.0.1]:55161 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uDxUY-0003jE-Lw
	for submit <at> debbugs.gnu.org; Sat, 10 May 2025 23:36:46 -0400
Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:43273)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <manphiz@HIDDEN>) id 1uDxUR-0003ij-Fk
 for 78366 <at> debbugs.gnu.org; Sat, 10 May 2025 23:36:40 -0400
Received: by mail-pj1-x1029.google.com with SMTP id
 98e67ed59e1d1-309fac646adso4222567a91.1
 for <78366 <at> debbugs.gnu.org>; Sat, 10 May 2025 20:36:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1746934589; x=1747539389; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=QHShRfXzQr2h4ADLt7E95ybtGDXPoW7OGzjGFKfni+s=;
 b=B4EzndLr9j7pgNWbs6CA7w0OQTxGbhEF2oNSjM3Gfc/BSggjfNCBxPaQ+7+zOz3Cco
 B86L3+81LGWrnTcBx4gHsM8Y8rlg2XH/HXcfr3cq/T6/5ucdBHz1IYzRGfPf3jlSZJij
 AkASnBdq9FbgFBAD+sUC0kYspz4OzFnknOlPPYn6TPzswwNOFLsfm6Nvj4SGH80zrIr5
 SlIlqdFPsQYfzDIe6FTI/D3k0nbOdhlXlRH/3S16urO8Ys6z5bvIJOtUw+CIgJR03Wx3
 kr7/61tXYjkbJ2HvVu0GinuT3HHXk2juHDWvrXtXH9hRKB4vYXM7tLrSG1Tn9jaJpi6z
 M64g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1746934589; x=1747539389;
 h=mime-version:message-id:date:user-agent:references:in-reply-to
 :subject:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=QHShRfXzQr2h4ADLt7E95ybtGDXPoW7OGzjGFKfni+s=;
 b=AtsdtI2RsVKaPJqxwFSuk1RPNq4aLCmKyVcL4QIKDC6SRvff4awhac5qxOhOHQa8nw
 12hvyIolqTHYtutI6tbcWlgf7X3rZAWieL1zZlwHgkAVEEjMXT3U7F9w7weNjyPBX0t4
 Sb1LDNxR6w94vBxTQ0BotSPHY/Vos34iWSs2pAwX4utcwgY6TbjW+yC+O3v7Ppi6ZMBR
 yAd/GuUFwL3rUqRygTyAXSBMEV4ExCod8UUeCCcjgnYv512wv6AG0eUi+IIPm6qLJtV/
 6PRcmVQ0nTwOefWgRQgDGlX2crBtquDR6F7MOmqpILBYG2y4qSchaoAka52zjd5yEWdl
 Sbtg==
X-Forwarded-Encrypted: i=1;
 AJvYcCUtGvP/oIFXW3pK1L9Q+5gq5655rWtElvLgQvCOzwVLwEn/dxPelgCPj392K+JBvQMfG0ZAsA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwkHlqaPaxH30OZJn2W0lZLug1Le6YdCRTl2+xB2oiqUxA1Ktnj
 Mz/8Lm3yfAfhS0Oco1IpllAV4j0mVpCi3FNLoUDre1saixiREoXGTpHZ6Q==
X-Gm-Gg: ASbGnctPKQ3DxlGmXbQ+3opglys5I2dicqYmW5yvIhlIvl0lF+ORoL1Uocjdptq7Khb
 /oG7VPNeZxCmyFwgWa8joBXAaUsmRhiMGvsPo+rs6UYG+jGDr1lSL6sr/VY/uEm1jIMSiq7oVA9
 7T4Fta507bWsaPtsocRFQVLYYZAHCddSQJkvPSkYksXS8U5IFKu7txEtbMMXMHcR2EDgT9UjG8a
 QHobkigyAoSodWp2i2Jd2NAcShBRNu0jYWCH+p4OfkA2VakRC36XUV01VjGZ5m/rBqoBduK8VXy
 CXK+5M/ISTl5H4R2yl6F/+mZ8cjFdK30/CLwC/u8QfUlM+zmuby3uI2mBv7+feSnvLwRqxoD2+5
 325QeFgk/cg==
X-Google-Smtp-Source: AGHT+IHLflmcxu2vAareMza3t2906AfzV2LoJo3W0QGdLVhFnPMbL+d+M9UQ2wE6qlltwkBIynbzww==
X-Received: by 2002:a17:90b:520d:b0:30a:9cd5:5932 with SMTP id
 98e67ed59e1d1-30c4000fa4emr14142844a91.13.1746934588816; 
 Sat, 10 May 2025 20:36:28 -0700 (PDT)
Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com.
 [76.94.249.45]) by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-b23493257bcsm3495036a12.6.2025.05.10.20.36.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 10 May 2025 20:36:28 -0700 (PDT)
From: Xiyue Deng <manphiz@HIDDEN>
To: Anush V <j@HIDDEN>, 78366 <at> debbugs.gnu.org
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
In-Reply-To: <87frhbdfvs.fsf@HIDDEN>
References: <87frhbdfvs.fsf@HIDDEN>
User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1
 (x86_64-pc-linux-gnu)
Date: Sat, 10 May 2025 20:36:25 -0700
Message-ID: <87msbj6cp2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78366
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Anush,

Anush V <j@HIDDEN> writes:

> Hello Emacs maintainers,
>
> I have two google mail accounts, the first one uses app passwords to
> authenticate, and the other uses oauth (because it doesn't support app
> passwords)
>
> When I enable auth-source-xoauth2-plugin-mode, I=E2=80=99m able to send e=
mail
> from second account without any issues.  But i=E2=80=99m unable to send e=
mails
> from the first account.  When I disable auth-source-xoauth2-plugin i=E2=
=80=99m
> able to send email from the first account.
>
> I think that enabling xoauth2 shouldn't interfere with other
> authentication methods, so this could be a bug.
>
> Thank you for your time
>
> * * *
>
> In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43,
> cairo version 1.18.2)
> System Description: Guix System
>
> Configured using:
>  'configure
>  CONFIG_SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-=
5.1.16/bin/bash
>  SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/=
bin/bash --prefix=3D/gnu/store/lq0nwm8qkj9cmyjm85z3dcqrjnglhcym-emacs-next-=
pgtk-30.1-rc1-2.7144e84 --enable-fast-install --with-pgtk --with-cairo --wi=
th-modules --with-native-compilation=3Daot --disable-build-details'
>
> --
> Regards,
> Anush
>
>

Thanks for your report!  Ideally auth-source-xoauth2-plugin should only
be in effect when your auth-source entry has "auth" set to "xoauth2".
Can you check whether you happen to set that for your auth-source entry
for the account using app password?  Sharing your auth-source entries
with your personal information removed would be helpful.

It would also help to share some of the error logs following instruction
in the "Debugging" section in README.org[1].  Please be careful not to
share any personal information from the logs.

[1] https://gitlab.com/manphiz/auth-source-xoauth2-plugin/-/blob/main/READM=
E.org?ref_type=3Dheads

=2D-=20
Regards,
Xiyue Deng

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmggGzkSHG1hbnBoaXpA
Z21haWwuY29tAAoJEC3pZe1jglyTbbEP/RTfuLS4k4x9iYNDUDNZn5AO/PbRE7s2
zsnfkyBxmlk4O494lbzV/6EFe79tH6GW0GX/4fUNE5ZjE7YqKEJ/LdTF4lEKnRnG
cXEiQOkxpEB78Wxl7EfvKmX6P1h9gMxz2VddzGJzYHpC2Iv1yIkKrcjVKIt0rNhf
d85d1LSq9rvTJp/4r8j5vL1U8IpFZT+iyRryMpMSOHHbCDD5sjBFeaP0mFYTewto
5gvxF3tJkE/BcSzSGcR7EaBacz+LAuxBFjRTn+m0nwFj/UW9pTiHe4X6+134OSZO
JYdHx7Rdtc4CF04FSmsYOsyMEz2/NyrRHDwuB2SXe3jLuV3N0BQ38L3Q76DsURUv
VZMPyUPIZrY+yvgxQtYOWzMM6feR8acLqhOUQjvqkJXk11Qp4RbsgLlQuH4tID3q
sxDK9ZeEvywyTzPFNvd6WLlqtftHhacjjzklD49vkZCGRJvQfqBAZ/By9KsMSH+J
sE6xIpFab3Mcdg0x3kHTPOpwk7H4J/StEf1qY7i+6hML/F5PmNy2Z3gDauGQIYo3
1n5bc+GzdQOHf/Y/igVDU5vxasHY4S94EcJOjbnkKXQX6OYkKTe5I6XiUlo/PUu0
oGOL1li59kNiGZOxGyJQOWobgbW70aKI0xWB90R39LTd6vdSPKFJKC/SRgKsybL0
GgqPUXjhj90F
=iCiw
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 May 2025 02:45:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 10 22:45:59 2025
Received: from localhost ([127.0.0.1]:54749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uDwhS-0000Ps-Rd
	for submit <at> debbugs.gnu.org; Sat, 10 May 2025 22:45:59 -0400
Received: from lists.gnu.org ([2001:470:142::17]:39778)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <j@HIDDEN>) id 1uDwhP-0000PA-4C
 for submit <at> debbugs.gnu.org; Sat, 10 May 2025 22:45:56 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <j@HIDDEN>) id 1uDwhG-0004EU-5G
 for bug-gnu-emacs@HIDDEN; Sat, 10 May 2025 22:45:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <j@HIDDEN>) id 1uDwhF-0007wx-UD
 for bug-gnu-emacs@HIDDEN; Sat, 10 May 2025 22:45:45 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to:
 references; bh=2wb+tqaP62gaWYID+jV47oDE4LJ7D/4pEgcoq9tu77c=; b=kBEP3StE10HKSX
 wIMiifsEAuNWbr5DDreAQBZ3tGWq76fRFiUrv99vVhlY+sAz2UwVuHb5RbtsElNURs7mC3uCza7JW
 V2UevdbQC/Dn4rQImgNk6iuwGxezRYFOYBlHjTZbAaReW7y0sEOEE+gfQ9sF+Jqkp0M8TT5oxbEBH
 A9atCp1Fe+q6lCJzemrRYKeft6n09nvJzKmL5JFz0dOQv9ePwLFSdG3wXATOIV8xwJLuGo5bNj0YQ
 0mfl8JziTBnYonV7JNAuRpgWBNucFnCJIsI2dJWGVYxBJcPNJARpvM41jdAnCXb04cqQGw3AHL35m
 jNFQd7Rj5ZhVsn8ajOyw==;
From: Anush V <j@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.1; auth-source-xoauth2-plugin conflicts with multiple Google
 accounts
X-Debbugs-Cc: manphiz@HIDDEN
Date: Sat, 10 May 2025 22:45:43 -0400
Message-ID: <87frhbdfvs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Hello Emacs maintainers,

I have two google mail accounts, the first one uses app passwords to
authenticate, and the other uses oauth (because it doesn't support app
passwords)

When I enable auth-source-xoauth2-plugin-mode, I=E2=80=99m able to send ema=
il
from second account without any issues.  But i=E2=80=99m unable to send ema=
ils
from the first account.  When I disable auth-source-xoauth2-plugin i=E2=80=
=99m
able to send email from the first account.

I think that enabling xoauth2 shouldn't interfere with other
authentication methods, so this could be a bug.

Thank you for your time

* * *

In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43,
cairo version 1.18.2)
System Description: Guix System

Configured using:
 'configure
 CONFIG_SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.=
1.16/bin/bash
 SHELL=3D/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/bi=
n/bash --prefix=3D/gnu/store/lq0nwm8qkj9cmyjm85z3dcqrjnglhcym-emacs-next-pg=
tk-30.1-rc1-2.7144e84 --enable-fast-install --with-pgtk --with-cairo --with=
-modules --with-native-compilation=3Daot --disable-build-details'

--
Regards,
Anush




Acknowledgement sent to Anush V <j@HIDDEN>:
New bug report received and forwarded. Copy sent to manphiz@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to manphiz@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#78366; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 26 May 2025 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.