GNU bug report logs - #78240
30.1; xoauth2 authentication fails in gnus imap mail fetching

Previous Next

Package: emacs;

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

Date: Sun, 4 May 2025 13:52:02 UTC

Severity: normal

Found in version 30.1

Full log


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

From: Robert Pluim <rpluim <at> gmail.com>
To: Xiyue Deng <manphiz <at> gmail.com>
Cc: 78240 <at> debbugs.gnu.org, j <at> gnu.org
Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail
 fetching
Date: Wed, 06 Aug 2025 09:56:38 +0200
>>>>> On Tue, 05 Aug 2025 11:01:25 -0700, Xiyue Deng <manphiz <at> gmail.com> said:

    Xiyue> Hi Robert,
    Xiyue> Robert Pluim <rpluim <at> gmail.com> writes:

    >>>>>>> On Sun, 04 May 2025 16:43:28 -0700, Xiyue Deng <manphiz <at> gmail.com> said:
    >> 
    >> 
    Xiyue> I have only tested using Gnus with nnimap (see documentation at [1] or
    Xiyue> [2]) where you want to add `(nnimap-authenticator xoauth2)' to your
    Xiyue> `nnimap' settings.  I haven't tested with `mail-sources', which seems to
    Xiyue> work differently compared to nnimap, and hence the implementation may be
    Xiyue> missing.  I probably need to understand how `mail-sources' works and
    Xiyue> extend the plugin accordingly, which could take a while.
    >> 
    >> Hi Xiyue,
    >> 
    >> I implemented auth-source lookup for imap.el (patch below). Would
    >> there be any chance to see if you could extend your package to support
    >> xoauth2 for imap.el?
    >> 
    >> It should be enough to add xoauth2 to `imap-authenticators', and
    >> `imap-xoauth2-auth-p' and `imap-xoauth2-auth' to
    >> `imap-authenticator-alist' (and their implementations, of course).
    >> 

    Xiyue> Thanks for implementing this!  As I haven't used imap.el I cannot test
    Xiyue> this right now.  I'll try to find some time to set up such an account
    Xiyue> and report back.  Hopefully this won't take too long.

If you have an existing nnimap server using xoauth2, then testing
against it with imap.el is easy:

(progn
  (require 'imap)
  (let ((i-buf (imap-open "imap.gmail.com" 993 'tls)))
    (imap-authenticate nil nil i-buf)
    (imap-mailbox-lsub "*" nil nil i-buf)))

If xoauth2 support is working, then that should auto-detect it and use
your xoauth2 credentials from .authinfo

If it doesnʼt work, then customize `imap-log' to t before loading
imap.el, and there will be an "*imap-log*" buffer containing a session
trace.

Robert
-- 




This bug report was last modified 7 days ago.

Previous Next


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