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

Previous Next

Package: emacs;

Reported by: Anush V <j <at> gnu.org>

Date: Sun, 11 May 2025 02:46:02 UTC

Severity: normal

Tags: fixed

Found in version 30.1

Fixed in version 31.1

Done: Robert Pluim <rpluim <at> gmail.com>

Full log


Message #14 received at 78366 <at> debbugs.gnu.org (full text, mbox):

From: Xiyue Deng <manphiz <at> gmail.com>
To: Anush V <j <at> gnu.org>
Cc: 78366 <at> debbugs.gnu.org
Subject: Re: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with
 multiple Google accounts
Date: Tue, 13 May 2025 09:55:24 -0700
[Message part 1 (text/plain, inline)]
Hi Anush,

Anush V <j <at> gnu.org> writes:

>> From: Xiyue Deng <manphiz <at> gmail.com>
>> Date: Sat, 10 May 2025 20:36:25 -0700
>>
>> Hi Anush,
>>
>> Anush V <j <at> gnu.org> 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’m able to send email
>>> from second account without any issues.  But i’m unable to send emails
>>> from the first account.  When I disable auth-source-xoauth2-plugin i’m
>>> 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=/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/bin/bash
>>>  SHELL=/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/bin/bash --prefix=/gnu/store/lq0nwm8qkj9cmyjm85z3dcqrjnglhcym-emacs-next-pgtk-30.1-rc1-2.7144e84 --enable-fast-install --with-pgtk --with-cairo --with-modules --with-native-compilation=aot --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=heads
>
>
> I did some debugging.  According to comment “;; A string result is an
> error.” 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.
>
> [...]

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

-- 
Regards,
Xiyue Deng
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 14 days ago.

Previous Next


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