From unknown Thu Aug 14 18:37:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78240 <78240@debbugs.gnu.org> To: bug#78240 <78240@debbugs.gnu.org> Subject: Status: 30.1; xoauth2 authentication fails in gnus imap mail fetching Reply-To: bug#78240 <78240@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:37:03 +0000 retitle 78240 30.1; xoauth2 authentication fails in gnus imap mail fetching reassign 78240 emacs submitter 78240 Anush V severity 78240 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 04 09:51:42 2025 Received: (at submit) by debbugs.gnu.org; 4 May 2025 13:51:42 +0000 Received: from localhost ([127.0.0.1]:55035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBZkr-0006FY-Fk for submit@debbugs.gnu.org; Sun, 04 May 2025 09:51:42 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47388) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBZkm-0006EB-17 for submit@debbugs.gnu.org; Sun, 04 May 2025 09:51:37 -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 ) id 1uBZke-00038h-IV for bug-gnu-emacs@gnu.org; Sun, 04 May 2025 09:51:29 -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 ) id 1uBZkd-0003Nk-VM; Sun, 04 May 2025 09:51:28 -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=W/h2KpS9yXyhcMiJehc650Y3DFyP4cyoFmaGWu9lDCo=; b=E8M0NbnRiSxi/r kUDDwxo9+OeNZ30BgzpVn1Afsv0EAo/p0WcHF/BeiexUQptIljCQEZB0G010jIK+s/rtRvcv1gIAh LqheWWwSwiK1RkHpUm1tKC9WU6+7PDHNZmcTjwawgJKJRM6iU4Y5Ryeqomr7vaomWLpd/iN5v7zKn ism4sDSXPpeEGoVY7EigIjXfnxsXj5yPdt4cArS6PiOf1VXfoQsbDAC110jqqlDZoHz/CFNxHPBNe hOUd7vZA8KPwegpKA74+j+TFwpbHoCxRlgd0xo5LLY3q+uEIG7JdDIjAHeY1vnrRPW3WYPpgPVSqx /2+awCwzLFojNl2fBwBA==; From: Anush V To: bug-gnu-emacs@gnu.org Subject: 30.1; xoauth2 authentication fails in gnus imap mail fetching Date: Sun, 04 May 2025 09:51:10 -0400 Message-ID: <87zffsbi29.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) X-Debbugs-Cc: 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 Cc: manphiz@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Emacs Maintainers, I=E2=80=99m using gnus and I=E2=80=99m unable to downloads emails using xoa= uth2 authentication (provided by auth-source-xoauth2-plugin). I=E2=80=99m able = to send emails though. Configuration: ;; emacs --no-init (setopt imap-log t) (require 'mail-source) (add-to-list 'mail-sources '(imap :server "imap.gmail.com" :port 993 :user "" :stream ssl ;; dont delete from server :dontexpunge t ;; mark as seen after fetching :fetchflag "\\Seen" :authentication xoauth2 )) (setq gnus-select-method '(nnnil "")) (setq gnus-secondary-select-methods '((nnmaildir "mail" (directory "~/tmp") (get-new-mail t)))) corresponding logs Waiting for response from imap.gmail.com...done Mail source (imap :server imap.gmail.com :port 993 :user :s= tream ssl :dontexpunge t :fetchflag \Seen :authentication xoauth2) error (I= MAP error: nil) nnmaildir: Reading incoming mail (no new mail)...done I suspect the imap-authenticate call in mail-source-fetch-imap is failing because xoauth2 and its related CHECK/AUTHENTICATE functions are missing from imap-authenticator-alist Please let me know if i=E2=80=99m wrong/missing something. Since auth-source-xoauth2-plugin is an elpa package, i mailed here and cc=E2=80=99ed the package maintainer. If this is wrong place for this, ple= ase let me know the appropriate mailing list. 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' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB -- Regards, Anush V From debbugs-submit-bounces@debbugs.gnu.org Sun May 04 19:43:45 2025 Received: (at submit) by debbugs.gnu.org; 4 May 2025 23:43:45 +0000 Received: from localhost ([127.0.0.1]:35113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBizp-0000u0-34 for submit@debbugs.gnu.org; Sun, 04 May 2025 19:43:45 -0400 Received: from lists.gnu.org ([2001:470:142::17]:41558) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBizm-0000tj-CF for submit@debbugs.gnu.org; Sun, 04 May 2025 19:43:42 -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 ) id 1uBizg-0004jY-IZ for bug-gnu-emacs@gnu.org; Sun, 04 May 2025 19:43:36 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBize-0006m2-LM; Sun, 04 May 2025 19:43:36 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-224171d6826so55963865ad.3; Sun, 04 May 2025 16:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746402212; x=1747007012; darn=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=oIravh7oOzUmOhvRSTsc3gwfQKjygPjosfFaOYP53c4=; b=MMzYbEDkyrAz7fOv2QugrKPeup/RS2hgtAJhsxUxy4Sb1LxaQceCSqFmlrrmnYKi1j JOLMRvpiRjRBXTRsN6JJxy/C+fvySh0bpwTAkEQ7ZpNWks2jBIu/k4ab9pNXF+Y8K1qx TUHA5cyWsMw/R0pzA3uYUjc0++RLGXanKXYTUlPLUynddmGXCIt1xqWaRKzuyEHnbiTT KGPjuNPYk0IH6P9ixRLkh8BqeAJntcdszNb1dtIjpjEhNcDbRQK2E8PJ480OG0JdS/S/ HrxVR1iE22ptFawtm8atj8KZUdSZ2qGQK6qdcxFgeVI0F4liU9ExVs2wqXOM6IxDZz9D tduQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746402212; x=1747007012; 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=oIravh7oOzUmOhvRSTsc3gwfQKjygPjosfFaOYP53c4=; b=gRwUWUWxrTyRva0NKVQtKHqw/099zwczHu6zsZ/lQw1ForzT0cpyXtnX4tJEE5MWr6 1lzwaSf0K9b1vTssxIzktK6or/p/A+VwaSaSAzrQ9myIEDz5GnzrHwCfuzXxn1ljYW6k slVgVlVO0sB2tKLtuCgJDf83s1E8wFSNiQEdkcq8o5U4BLTooEEZpHhugqoXCrHeM24q cC9CBmz3wr8JFuTvyt/vLRWnXvXOokmHTFFBjY4wdmqUjekft6862vdoxC2H+O+kJfQU 73/Hz80w1+XLt0+3docyYl91Fo2rmHYsxdEK3r3K0TU4vA2E/5xBl3RuMu19bGhmstDr 3gUQ== X-Forwarded-Encrypted: i=1; AJvYcCWzw4+e14VGZiym9JvWkKPs40jTr2xwxisGmiL2j7uIreDY1IKFEarGtNMd0DObsXNOhpn2ue5XfQaqYRAZ@gnu.org X-Gm-Message-State: AOJu0YxJmhFTamVQaUHzv0udkjExSgjjWFV/xNZzV2hBhT6PEMnklNCp fZG2xyxYImL5ongYuUHwlZDX/Lfw8TqR50JOFoM4LdlXCzHcVaZb2EYNOw== X-Gm-Gg: ASbGncvjMvP7wSIPlP7Pbn7YRZtLo6cPL8kT41UbUkERJM5VYgvivO/pxJp/6fmk/gK 0Tj0fhA+u2JGxnulTeY4FU6IVPNhg+b3E907JWtmjVuHtiwIrmG6m+7sUnrO3ShbggaNZ2JpHCg yVxL17CO1qq7Npnc/3V265wlBu/NtecIRb78VNuWbC1EWqhkiQgiFhT19BjxdfgH3a2En4JpoNP A6QGmCECtdf2Hc+bEf5t+A2udie96NwPJfmLc/KT/T8/z79JxJ/pvICpl0qJ0kw5LbPK1MumP/6 gKm2iBZwoOIzMaPUvisW/JY8pIRx9YTP3IpI8ooK7XoaCEXOChz8DL3/pbbarrAe+fQDxEzGRVk = X-Google-Smtp-Source: AGHT+IEPSn9MOukbcV4ncs4M7KHxnjKpxPh8MZRWPnq0Aruw0pWhg6lysn30bqfH1nkkgH4/fpO9CA== X-Received: by 2002:a17:903:2344:b0:224:191d:8a79 with SMTP id d9443c01a7336-22e1ea3d029mr62515275ad.27.1746402212033; Sun, 04 May 2025 16:43:32 -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-22e15228ffdsm42239895ad.179.2025.05.04.16.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 May 2025 16:43:31 -0700 (PDT) From: Xiyue Deng To: Anush V , bug-gnu-emacs@gnu.org Subject: Re: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87zffsbi29.fsf@gnu.org> References: <87zffsbi29.fsf@gnu.org> User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1 (x86_64-pc-linux-gnu) Date: Sun, 04 May 2025 16:43:28 -0700 Message-ID: <87h6206ixr.fsf@debian-hx90.lan> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=manphiz@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Anush, Anush V writes: > Hello Emacs Maintainers, > > I=E2=80=99m using gnus and I=E2=80=99m unable to downloads emails using x= oauth2 > authentication (provided by auth-source-xoauth2-plugin). I=E2=80=99m abl= e to > send emails though. > > Configuration: > ;; emacs --no-init > (setopt imap-log t) > (require 'mail-source) > (add-to-list 'mail-sources '(imap :server "imap.gmail.com" > :port 993 > :user "" > :stream ssl > ;; dont delete from server > :dontexpunge t > ;; mark as seen after fetching > :fetchflag "\\Seen" > :authentication xoauth2 > )) > (setq gnus-select-method '(nnnil "")) > (setq gnus-secondary-select-methods > '((nnmaildir "mail" > (directory "~/tmp") > (get-new-mail t)))) > I have only tested using Gnus with nnimap (see documentation at [1] or [2]) where you want to add `(nnimap-authenticator xoauth2)' to your `nnimap' settings. I haven't tested with `mail-sources', which seems to work differently compared to nnimap, and hence the implementation may be missing. I probably need to understand how `mail-sources' works and extend the plugin accordingly, which could take a while. Meanwhile, do you want to try using `nnimap' and see whether that works? > > corresponding logs > > Waiting for response from imap.gmail.com...done > Mail source (imap :server imap.gmail.com :port 993 :user = :stream ssl :dontexpunge t :fetchflag \Seen :authentication xoauth2) error = (IMAP error: nil) > nnmaildir: Reading incoming mail (no new mail)...done > > > I suspect the imap-authenticate call in mail-source-fetch-imap is > failing because xoauth2 and its related CHECK/AUTHENTICATE functions > are missing from imap-authenticator-alist > > Please let me know if i=E2=80=99m wrong/missing something. > > Since auth-source-xoauth2-plugin is an elpa package, i mailed here and > cc=E2=80=99ed the package maintainer. If this is wrong place for this, p= lease > let me know the appropriate mailing list. > > 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' > > Configured features: > ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ > JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP > NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS > TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB > > -- > Regards, > Anush V [1] https://elpa.gnu.org/packages/auth-source-xoauth2-plugin.html [2] https://gitlab.com/manphiz/auth-source-xoauth2-plugin/ =2D-=20 Regards, Xiyue Deng --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmgX+6ASHG1hbnBoaXpA Z21haWwuY29tAAoJEC3pZe1jglyTvdsP/jNlk/UU0TMrZee2bxzD9922DGor10Nj Qb1gx+R84UHVI0cArkPbgvyxcrzeNlkU3HF3v7m6hCGeUc/U1K+l1xYoxoTxgD74 8XEIyZbYM6UoxROueJoFm7JSXag18uhKVfTZF/DKxfFGT0VqkHZpsfh5x9M6VDDD /AzXQHqImlUibl/gJgbylYECbKe4trN/oYIH9o+xuo+y3pULBAmOZI9hazfCaL/j afxmcghUmblfmLJ1tRhR7TsrY7RoZvaFo76p14u8qQI5QTZx9OjwXM44y7e7DfSk rvgsAhU7JJrH8vllqzE+vqz9Nwz1j7mJULKO0F9YrHcCGEs35Ly8I8NGo8wDJyqz sd58oLo0zYqmUk5SIxThX0XoC6ynzyMK9uuxZnSxyhkt6LKXGqYB/Ouo6jtK6kif afT40KjJiHAb5Qry7SNBBSDs2IrzhGAEZwPed9wBw6KTV8KX4v5TZ4Y9+o3OIoNQ vmsa8mf1I3eCrJwqNtptBlTWsoTsfyMja7hXv7lJI2U2JTz/OZ2NCYz6EEjyOtPZ sTi3i3DDKIstX+CMpsKx2RTtIdphbAbd7t/sEsEHqvtkAFC/vBfai0rl4tRZuoDF Qv8xNB/3QGKds699H1pdWoI/5CfVZKvtZqw0OmYkhqlMeDPcAfTQQlWZyXLLnkmU LX8L6NDuGsFy =roUH -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 04 23:11:23 2025 Received: (at submit) by debbugs.gnu.org; 5 May 2025 03:11:23 +0000 Received: from localhost ([127.0.0.1]:36566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBmEl-0007nv-Bj for submit@debbugs.gnu.org; Sun, 04 May 2025 23:11:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:40466) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBmEi-0007nU-56 for submit@debbugs.gnu.org; Sun, 04 May 2025 23:11:20 -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 ) id 1uBmEb-0006vT-1H for bug-gnu-emacs@gnu.org; Sun, 04 May 2025 23:11:13 -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 ) id 1uBmEa-0002l1-OG; Sun, 04 May 2025 23:11:12 -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=7aHY++EYeYA1LFkreQB8AiCAgTOxA7zCCdSlol6e4Ac=; b=phmKa3PooY35UAJDNmBw 3IKQ8zUoYpGDELudyTNxowT34aXB59urgO8sgYl+bAMr0Fh6YcM6Pt1WbWK9Egg7B5zTiaEbVHBR3 yoxuE3p1Zbl8rZungIstd6krMMAbE6pbCLlixf4XooKhjmPoVbEamKmzEQEasPmevqYX7FzU9E2Ip UGrEeucTjMHDZLIqnsfpw8A2bwC2nL7SSoCRwMd3zJha2RutUNg855m8m7JhWrXv96chvEcjXzzBq ZuZ/casXseDS7rolBk6qnZNbUBCsfDNcioyDUTz+5VylQSWQg26p0gKcOZQyflKFAuzHyujVUHYIG yvbxKntsOYO5wA==; From: Anush V To: Xiyue Deng Subject: Re: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87h6206ixr.fsf@debian-hx90.lan> (Xiyue Deng's message of "Sun, 04 May 2025 16:43:28 -0700") Date: Sun, 04 May 2025 23:10:09 -0400 Message-ID: <87ikmfvjla.fsf@gnu.org> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> 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 Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Xiyue Deng > Date: Sun, 4 May 2025 16:43:28 -0700 > > Hi Anush, > > Anush V writes: > >> Hello Emacs Maintainers, >> >> I=E2=80=99m using gnus and I=E2=80=99m unable to downloads emails using = xoauth2 >> authentication (provided by auth-source-xoauth2-plugin). I=E2=80=99m ab= le to >> send emails though. >> >> Configuration: >> ;; emacs --no-init >> (setopt imap-log t) >> (require 'mail-source) >> (add-to-list 'mail-sources '(imap :server "imap.gmail.com" >> :port 993 >> :user "" >> :stream ssl >> ;; dont delete from server >> :dontexpunge t >> ;; mark as seen after fetching >> :fetchflag "\\Seen" >> :authentication xoauth2 >> )) >> (setq gnus-select-method '(nnnil "")) >> (setq gnus-secondary-select-methods >> '((nnmaildir "mail" >> (directory "~/tmp") >> (get-new-mail t)))) >> > > I have only tested using Gnus with nnimap (see documentation at [1] or > [2]) where you want to add `(nnimap-authenticator xoauth2)' to your > `nnimap' settings. I haven't tested with `mail-sources', which seems to > work differently compared to nnimap, and hence the implementation may be > missing. I probably need to understand how `mail-sources' works and > extend the plugin accordingly, which could take a while. > > Meanwhile, do you want to try using `nnimap' and see whether that works? > Thank you for considering extending the functionality to mail-sources. I tested nnimap and it works as expected. However, unlike mail-sources, nnimap doesn't download emails to my machine. -- Regards, Anush Veeranala From debbugs-submit-bounces@debbugs.gnu.org Mon May 05 10:25:18 2025 Received: (at 78240) by debbugs.gnu.org; 5 May 2025 14:25:19 +0000 Received: from localhost ([127.0.0.1]:41345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBwkw-0001yL-Lg for submit@debbugs.gnu.org; Mon, 05 May 2025 10:25:18 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:44383) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uBwkr-0001sF-2p for 78240@debbugs.gnu.org; Mon, 05 May 2025 10:25:14 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43cfe574976so27051525e9.1 for <78240@debbugs.gnu.org>; Mon, 05 May 2025 07:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746455106; x=1747059906; 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=Bfc7SneopwIO+fiyucJwAOeal1YYkqNDGkXz314AI38=; b=W+4zOkDnewM9D9+onGo7sF4tY+NAdA5H2gMTRn2iegbUmGiJ5xT9SaL2zjX2cX5Bq2 9hxCMSSEpmhS30dnUNdny82H6Fq3YjDcoKZiPHuFAb3NofHNNq1bXYxftDwdGx7nZrJO eWwCBq/gUAmry0kg4OmrrDCklz5xaqPYoAkF3gZLd/tGKvu/Cb+sW8anEzC1yCz1KMUr pzlsSV3K/05IDOczsDgWgSjoNrC8U61p18BvXECU6lfsIMDLKzhDR/vka1ngN3ALe7o7 sscnQngd9wnskewkZOA+uU6/6ptkCZ15yOVPRydFxlOhevd2KVC0Uwe5dfSzLOLCW+H+ A6Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746455106; x=1747059906; 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=Bfc7SneopwIO+fiyucJwAOeal1YYkqNDGkXz314AI38=; b=FtBlSwlRofa5q2Fox1B2W3AWpfia6cN24d5tipZe4+up+mnSJObk7PS3CTWR3oP390 rmzmLGQu/PFfzPLGLDnG2Wcf4nYkIIryahmWNsoCuV76gtA0+ppSBYIxfUtcUttkiU1G 5ZrztQnGzgdiaCQ7UM1zB1dztpYj4mc92g3xJYo2yfhgA5RcxnY9v56mgKIzlGxNLswm brkyd5ZToP5puAUmG0f+rE+Xrur5uCGS+cTejLMNoQMhfxgwzC7++nyahsPQsM9gBFIb PIDjjjj9mW6mgFHn1BVl9HAEl3z32D5KkotYjTgO9vAca6GW4ndwJ5AovYc8NoNgsLKU 6p2w== X-Forwarded-Encrypted: i=1; AJvYcCUTkuoOsJckHTVOkGDn0inz320z3vwJ0pQp0aVBaErhUaYr2AC+1ly/m/XExikvKSxFOn1csw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxcAQBgQQVso+V8421fV6ZxFqxeq4VpVnXWC/OoduNAUJc5NRAZ KTgVmMGEOY34Y2yvmgiLcHyeOoN+rHMpC22EH4xqncEpGJll1jeOyPx4GeBZ X-Gm-Gg: ASbGnctmq3nX4hXGBkRggHd73qmGxHphtw0yrbmd6Kc8tZX0Hi7BhYF794CPdPlybn8 Mhdrb1HvT9OLYCsdsppRPlPGuBwjmpS8G3YJSSBJIJOTsPl6cHNfNLmgwOk5WeZZbdTvei4SbZz m/67DvvWCmlYAjgHId7yvW+7irHPMs9KAVQkiffU932haFmcky5CnQRutGNhPJDgkau6jKTVxtX I1hzgeGH/qQkez+9S+Fce0N5oNM3LhEGV890EwObMVCbdnAQeIS4q/VIthlPonZrRZWvRwKqnUT 4lW6KqS/+iDc+1WI+MnbUdoPKVkz X-Google-Smtp-Source: AGHT+IF9n2HgtOVGlFnfJF5dF/gwA3yF+1CuRs8Kjd7wHLC4kCXCW89wxfsnOD28mBZ1tj1/rAJhVg== X-Received: by 2002:a05:600c:350e:b0:43c:e478:889 with SMTP id 5b1f17b1804b1-441bbe2c815mr123469785e9.0.1746455105996; Mon, 05 May 2025 07:25:05 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:ceae:e921:6f5e:cefa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-441b89cc480sm138286815e9.2.2025.05.05.07.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 May 2025 07:25:05 -0700 (PDT) From: Robert Pluim To: Anush V Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87ikmfvjla.fsf@gnu.org> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <87ikmfvjla.fsf@gnu.org> Date: Mon, 05 May 2025 16:25:05 +0200 Message-ID: <87y0vbt9ry.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78240 Cc: 78240@debbugs.gnu.org, Xiyue Deng X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Sun, 04 May 2025 23:10:09 -0400, Anush V said: Anush> I tested nnimap and it works as expected. However, unlike Anush> mail-sources, nnimap doesn't download emails to my machine. It will if you configure `nnimap-split-methods' to copy from the nnimap backend to a local one. Or just copy the emails manually. (I took a look at imap.el. It currently has zero integration with auth-source, so getting nnimap to work should be a lot easier). Robert -- From debbugs-submit-bounces@debbugs.gnu.org Tue May 06 21:55:16 2025 Received: (at 78240) by debbugs.gnu.org; 7 May 2025 01:55:16 +0000 Received: from localhost ([127.0.0.1]:36771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCU0B-0006Ug-Nc for submit@debbugs.gnu.org; Tue, 06 May 2025 21:55:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51572) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uCU08-0006Pu-DU for 78240@debbugs.gnu.org; Tue, 06 May 2025 21:55:13 -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 ) id 1uCU03-0004Ot-0l; Tue, 06 May 2025 21:55:07 -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=paAKtOiQt5Dr5yQX4iTkOMAhpVy+chuX6WKZVXjeotc=; b=NOfAUZfJD4pz9wGEH7Kk nJbaXfNtDZk0CWif54niwVaNah+7u1kRJ6WiioD7K+5RnaVQOhNIf99xbhgBu2Co5oFMUm+XXAgDK VZQLT5rqwIDUySNEHxQ+ASR3nbsL7Cm2y4mWZuRx2zrAg0E3o0iVCyqbb/GKG8sliD8N+Cpsj2Cpx x97K9UZViUdUuZkHjIc0Fi9w3CzU86TrboRwAwwsFAwknfETLSwQtKnrnPlJ12Z09+Lew3ljlBvrs fPQIKdjbJ43W/VwYkPmMUF27I0nzKidh/9Hakev5g9Cato267dmHxaUriwk+GRE0XB8OHQSnJoYWS JnbaJc+i+MSvOg==; From: Anush V To: Robert Pluim Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87y0vbt9ry.fsf@gmail.com> (Robert Pluim's message of "Mon, 05 May 2025 16:25:05 +0200") Date: Tue, 06 May 2025 21:54:13 -0400 Message-ID: <87jz6tmbi2.fsf@gnu.org> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <87ikmfvjla.fsf@gnu.org> <87y0vbt9ry.fsf@gmail.com> 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: 78240 Cc: 78240@debbugs.gnu.org, Xiyue Deng X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Date: Mon, 5 May 2025 16:25:05 +0200 > >>>>>> On Sun, 04 May 2025 23:10:09 -0400, Anush V said: > > Anush> I tested nnimap and it works as expected. However, unlike > Anush> mail-sources, nnimap doesn't download emails to my machine. > > It will if you configure `nnimap-split-methods' to copy from the > nnimap backend to a local one. Or just copy the emails manually. I couldn=E2=80=99t figure out from info manual how to copy mails to local using nnimap-split-methods. I tried (nnimap-split-methods '("nnmaildir+mail:inbox2" "")), but it ended up splitting mails on the server. I=E2=80=99m able to copy the emails manually though. -- Regards, Anush From debbugs-submit-bounces@debbugs.gnu.org Wed May 07 03:19:15 2025 Received: (at 78240) by debbugs.gnu.org; 7 May 2025 07:19:15 +0000 Received: from localhost ([127.0.0.1]:39564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCZ3i-0004NV-NT for submit@debbugs.gnu.org; Wed, 07 May 2025 03:19:15 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:56459) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCZ3g-0004MN-Fw for 78240@debbugs.gnu.org; Wed, 07 May 2025 03:19:12 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43ce70f9afbso57510615e9.0 for <78240@debbugs.gnu.org>; Wed, 07 May 2025 00:19:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746602346; x=1747207146; 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=WqTgmlo/GuPOQTPglXqqwbaIMnBGLgUAoD//imUPDk8=; b=ZXWSYfWA/VI5Ox1XYSKJJI4Tp7aGDfDuy2FGAea/i/lWC1UqHU4EcqzGdrX20S3Wg6 cEVqZT53uVtG/4vzIyjY0TfBFCrdVDZubtoe9qrMtwCnhHRfGLwW3FlHpcruweRG57Ke XphCWF9UZYvoiciamBR+urO3wQGlkP9pOOJyeDgTKZOUeglbRuE+hJCvuSmM+Ixjdl89 11f/42qVumpjJTGfAynECDpVG4F5YJmYx20+PGM0in0C9pl4PrZemtqEGiIQoiR48f6Z 3eY2TeXaKxKsF040G7EKpqNAfO0WZvzau6kz+87lawpwhE38Eo6Va+ev+kGuHniG8x01 pPdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746602346; x=1747207146; 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=WqTgmlo/GuPOQTPglXqqwbaIMnBGLgUAoD//imUPDk8=; b=jcBw/ZXxzFEumQyc+I1gfmTFIpmka+7s/XDmu7aRWueGoXoo0q3KztRGHBGmVo4Oym HIaxzc6ARXMvMSOVBSvGJsxf/KX+l5meWxYhRkbTFu+vbgsnbl7ebNtaVBbMv3TUUHPf LcdXIn8z/fTaquyOqhp1dZYWh8BnF2KG0FqGbot+5beHN8j2UhJkI4Skq3Dc+ga6DwNp ADG8Mv//r2Vv+oACmihnjRBE7yhtplNFUkCkW6Je5rqBClg4sfX4kBp1kkpeinx5gPB1 ZEcYuv5AK1fKMBiLbfWC2uo8u3k60DOKugX9Ks3i84nWTqA8JAWUcxrym8B3MmmV4Nls +yZQ== X-Forwarded-Encrypted: i=1; AJvYcCUhXcctOQRO2cllsgyFAnJsfBlGq0QZVw1SzHr8dJmLgZWqqm5I+HoAI38R2C2GqGUJfWg7qg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxqzauB2admfSLgAQe1j0R5Zx42BcAPe8NzE8wrhW7FzILBEHN3 voKS2bYPEDGIDxlb0dF/ZSnbFRsZExduOCdKKOAmz3bSfUgqaP25Orhn/cO0 X-Gm-Gg: ASbGncub9svpi6lO24KcHe+2yKE+0F9aCdF8y+8X5T4vDYL4WSoVeWkh/Bfcc2yTQNl o3tePWwFkW+AwMxWgwnI8Ufi+UAMLmeZ4UOv8RYlzSctUVIi2claeHRFtd7ar6FJyzHcC5lKbcE xZSGYzPa+SSq0GD550+YND/bpKMODm2rhuy7XqobZTowTpvGuqJ2d3HL+0beaaZbYhp+/OwS/Qc lA+hmQyLWn4D60tDUv9hmDs1FqAf5mdfZeopjt2suXIoehMU+WhkSdGMRSGpriRmlwx6AScPT3Z P3UYZAyKklQOQS19BHnr239hKpHg X-Google-Smtp-Source: AGHT+IGYUCz7sehQHkqc29i83Ys2S3znAPy7cG1lLjgkEjwnADY7f+ZZgeehu8gCPJ+8NIS1EU7A4Q== X-Received: by 2002:a05:600c:8207:b0:43c:fcb1:528a with SMTP id 5b1f17b1804b1-441d44aefefmr13618995e9.6.1746602345722; Wed, 07 May 2025 00:19:05 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:7c24:f9c7:a55c:5712]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-441d43919basm20862875e9.30.2025.05.07.00.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 00:19:05 -0700 (PDT) From: Robert Pluim To: Anush V Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87jz6tmbi2.fsf@gnu.org> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <87ikmfvjla.fsf@gnu.org> <87y0vbt9ry.fsf@gmail.com> <87jz6tmbi2.fsf@gnu.org> Date: Wed, 07 May 2025 09:19:04 +0200 Message-ID: <87cyckubvb.fsf@gmail.com> 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: 78240 Cc: 78240@debbugs.gnu.org, Xiyue Deng X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 06 May 2025 21:54:13 -0400, Anush V said: >> From: Robert Pluim >> Date: Mon, 5 May 2025 16:25:05 +0200 >>=20 >>>>>>> On Sun, 04 May 2025 23:10:09 -0400, Anush V said: >>=20 Anush> I tested nnimap and it works as expected. However, unlike Anush> mail-sources, nnimap doesn't download emails to my machine. >>=20 >> It will if you configure `nnimap-split-methods' to copy from the >> nnimap backend to a local one. Or just copy the emails manually. Anush> I couldn=E2=80=99t figure out from info manual how to copy mails= to local Anush> using nnimap-split-methods. I tried (nnimap-split-methods Anush> '("nnmaildir+mail:inbox2" "")), but it ended up splitting mails = on the Anush> server. I think that should be (nnimap-split-methods '(("nnmaildir+mail:inbox2" ""))) (but I don=CA=BCt do nnimap splitting) Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Sat May 10 18:27:51 2025 Received: (at 78240) by debbugs.gnu.org; 10 May 2025 22:27:51 +0000 Received: from localhost ([127.0.0.1]:52785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDsff-0000am-CK for submit@debbugs.gnu.org; Sat, 10 May 2025 18:27:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50318) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDsfa-0000aC-9p for 78240@debbugs.gnu.org; Sat, 10 May 2025 18:27:48 -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 ) id 1uDsfU-0001F6-Q1; Sat, 10 May 2025 18:27:40 -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=lVNfaZ1V8YHjKWkirQBCS9Fd1ww5UNX4XZieKJwganM=; b=n4aZhpuYmSGFaa9g2qXo w74m4OGO6f4gU+O6DZSmtyTsAZjOLjbbUUY1KBat9o5me4moEFsJU4ZldGwx45iMtzCTIPKtwji3i VAcXxjUhnAKJoQA8a5S/RYAokSG7H7ZYEFzMeGw1MBCbjeU0bZRhBDIQSx5hPYgHLWvHC3n47wOLb 58ZyZ+FmUA8rqMGMABfQUp50xwKyGJUItSDSTkRz5FYP8639hgA9WTh8R8Q/nqL6+uEdk9cQ4lrB3 0c3MNZ/kii5Dwx0IkOLrLDrJ8rnkNwcIt+GkNlD+MHpxEQBGZt9HBFgTxgEhwS9i83wzEhniyixo3 R/kF+aDhq4TMrg==; From: Anush V To: Robert Pluim Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87cyckubvb.fsf@gmail.com> (Robert Pluim's message of "Wed, 07 May 2025 09:19:04 +0200") Date: Sat, 10 May 2025 18:27:05 -0400 Message-ID: <87a57kw18m.fsf@gnu.org> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <87ikmfvjla.fsf@gnu.org> <87y0vbt9ry.fsf@gmail.com> <87jz6tmbi2.fsf@gnu.org> <87cyckubvb.fsf@gmail.com> 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: 78240 Cc: 78240@debbugs.gnu.org, Xiyue Deng X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Date: Wed, 7 May 2025 09:19:04 +0200 > >>>>>> On Tue, 06 May 2025 21:54:13 -0400, Anush V said: > > >> From: Robert Pluim > >> Date: Mon, 5 May 2025 16:25:05 +0200 > >> > >>>>>>> On Sun, 04 May 2025 23:10:09 -0400, Anush V said: > >> > Anush> I tested nnimap and it works as expected. However, unlike > Anush> mail-sources, nnimap doesn't download emails to my machine. > >> > >> It will if you configure `nnimap-split-methods' to copy from the > >> nnimap backend to a local one. Or just copy the emails manually. > > Anush> I couldn=E2=80=99t figure out from info manual how to copy mai= ls to local > Anush> using nnimap-split-methods. I tried (nnimap-split-methods > Anush> '("nnmaildir+mail:inbox2" "")), but it ended up splitting mail= s on the > Anush> server. > > I think that should be > > (nnimap-split-methods '(("nnmaildir+mail:inbox2" ""))) This also didn=E2=80=99t copy mails to local. -- Regards, Anush From debbugs-submit-bounces@debbugs.gnu.org Tue May 13 12:33:50 2025 Received: (at 78240) by debbugs.gnu.org; 13 May 2025 16:33:50 +0000 Received: from localhost ([127.0.0.1]:32893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEsZi-0001pf-1L for submit@debbugs.gnu.org; Tue, 13 May 2025 12:33:50 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:44207) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uEsZf-0001pN-1s for 78240@debbugs.gnu.org; Tue, 13 May 2025 12:33:47 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a1f9791a4dso2529909f8f.0 for <78240@debbugs.gnu.org>; Tue, 13 May 2025 09:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747154020; x=1747758820; 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=jZZbMeNGpTDTsFIOoNq9TPC7HHN17QnaL52eIeTBK9I=; b=IjeSkPF8H9W8UXgWE4GOUq1geO7BTU0kBijBISFHicvE+2KnYeqSoscdczW6MoQ4+W yl3LOrc5aCv292qxxavRTs7ITma2gOVcA4mxl+t68xfWlotthRQHUn8uDjuwzSEZKoz5 0rBB9D9Q/mk15VMEIsNPIziuT5wKapcyVOBvXw+KSxd2OitaPgYl2ulsto7pm51OhDoT aB9WKFpDguCj6KHVTbrr/+Jvawq26S7wvPXKtmIv4eJiAhd11PBxdWfQ3EQie23U0lyj qYDC1clRVrSd4QYpNloB9Iw86EflZSsEmGLg7RBUSTYo9CaC3FBJDra323/W60gIfgwJ /zMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747154020; x=1747758820; 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=jZZbMeNGpTDTsFIOoNq9TPC7HHN17QnaL52eIeTBK9I=; b=Ctd9BKj4KH8b3w7nDqIfNE7wOg6+nE9d3WHy55WxMppk0aEvovkm+KkZZ7JKeMkinZ fgmGQIP/x+TknXotoKWkQWW631p06u6pJnhzxSbCbKtv5v+4hbwyTlXTGPWwjPQugIwY ci6+AJDyP4/TniOGJmp6eQb3n1j57HxV0R1kjE/3g67mI4CUb7ZjVtI5CY8HNQ8d5Sza DPiQnm4hLe+RlNahAao0P8I2oEmeHfdyH4b+sZN89odzr2wYP+WizncxALE6JtLMgIhj 506826MCaKT/1Mpn9fWfTxyJgeZ0lENBoHStWrv8WOBijkxPxB1XCQyGiXABCTLXDrWN KeqQ== X-Gm-Message-State: AOJu0YwLXwMr/TVg7TeTRkSQUfWu7PuF8Ph3XZinylT9xv6Pe7rZnusy t6EFpWYLX4ezZskC6nvBG1vc6/oeUOrWuGy0Z6Xj7g189TGTanZt X-Gm-Gg: ASbGncsWLXnuyNnV0Eh8NwF8hLKHJl7YkheqEZSWQZTrvhByek2b8LTPqO5hmEqJDvl 9jmpstsKQSK8CZR5EWNF1nU/6rfnZvPc89GnKjQlXXB0NjN/VhPoWn2m2Ef2CPdLXK4xg+Czv4f oAnlaUOq4ivgSr55P+9VW+qauuEOn4sjoqie26nZ0X4vxvURl5+WTq/mdaKuOVoiZ6v9iIZd1ui XoTRuwlFphgihN7g1rd3jKbe4vjvDAQBoswKk7MhZ+IDVfQHbgu86Imgs4OLBvwyrYl897erJV+ FO2y1DPZORjca54qFRFUiAirBOa6VnC1zIdQ X-Google-Smtp-Source: AGHT+IHcg1FykPk6D91ajgtPLqmFrv6+Ff3FZ+Mbwv+mlJUnY7gfs3tSxMLw5lIZAZYFCJcCNAD5bg== X-Received: by 2002:a05:6000:1449:b0:3a0:8442:2c48 with SMTP id ffacd0b85a97d-3a1f64a48ecmr11905154f8f.44.1747154020273; Tue, 13 May 2025 09:33:40 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:f2c:3a8c:1717:88f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a1f57dde27sm17153006f8f.17.2025.05.13.09.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 May 2025 09:33:39 -0700 (PDT) From: Robert Pluim To: Anush V Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87a57kw18m.fsf@gnu.org> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <87ikmfvjla.fsf@gnu.org> <87y0vbt9ry.fsf@gmail.com> <87jz6tmbi2.fsf@gnu.org> <87cyckubvb.fsf@gmail.com> <87a57kw18m.fsf@gnu.org> Date: Tue, 13 May 2025 18:33:39 +0200 Message-ID: <878qn0mpwc.fsf@gmail.com> 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: 78240 Cc: 78240@debbugs.gnu.org, Xiyue Deng X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Sat, 10 May 2025 18:27:05 -0400, Anush V said: >> From: Robert Pluim >> Date: Wed, 7 May 2025 09:19:04 +0200 >>=20 >>>>>>> On Tue, 06 May 2025 21:54:13 -0400, Anush V said: >>=20 >> >> From: Robert Pluim >> >> Date: Mon, 5 May 2025 16:25:05 +0200 >> >> >> >>>>>>> On Sun, 04 May 2025 23:10:09 -0400, Anush V said: >> >> Anush> I tested nnimap and it works as expected. However, unlike Anush> mail-sources, nnimap doesn't download emails to my machine. >> >> >> >> It will if you configure `nnimap-split-methods' to copy from the >> >> nnimap backend to a local one. Or just copy the emails manually. >>=20 Anush> I couldn=E2=80=99t figure out from info manual how to copy mails= to local Anush> using nnimap-split-methods. I tried (nnimap-split-methods Anush> '("nnmaildir+mail:inbox2" "")), but it ended up splitting mails = on the Anush> server. >>=20 >> I think that should be >>=20 >> (nnimap-split-methods '(("nnmaildir+mail:inbox2" ""))) Anush> This also didn=E2=80=99t copy mails to local. Hmm, I get splitting when I also set `nnimap-inbox' appropriately, but it=CA=BCs all server side splitting, and it uses `nnmail-split-methods' instead of the nnimap variable, so either I=CA=BCve got a config issue or it=CA=BCs a a bug. I=CA=BCll keep looking over the next week. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Fri May 23 12:58:03 2025 Received: (at 78240) by debbugs.gnu.org; 23 May 2025 16:58:03 +0000 Received: from localhost ([127.0.0.1]:49881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIVic-0003tJ-Rc for submit@debbugs.gnu.org; Fri, 23 May 2025 12:58:03 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:58677) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIVia-0003sf-Ob for 78240@debbugs.gnu.org; Fri, 23 May 2025 12:58:01 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43ce71582e9so134565e9.1 for <78240@debbugs.gnu.org>; Fri, 23 May 2025 09:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748019474; x=1748624274; 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=rx8F3BfX8/7mTh/j/qLRdD3Q/aM088q0VZtRzuos3nY=; b=DWbCjJpAaGn6jr1WOFz3lnKviOrQKor5nYUrO4o1DMsK95dBLFZaC7v5kgMEXwB3+n AYVnOxHELprfySVyWDgdsJaQ+0xZqT+IyGRIOQf3CsmSsj7KL6XYapDhGBzFmlGNYZvh AGPcwJ5VxWNbfVbxnCIxgWuS97a3j1o1vLOP6TnwfSRCidPgutaJ7Px9LAS5otDEKaSm zt7vaToKNtbALYZ+s0iPveoFRXODqjqKrgnkY7BmwujyTrr63ZoM8mRfKRbYc8+/TwqT h4e2VKWrWVzWYciIyX34Z3DovxfF/TvsfUB0aeuAECG7xi/KaQn2LX2SIQN6XlPVP7jE 4mtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748019474; x=1748624274; 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=rx8F3BfX8/7mTh/j/qLRdD3Q/aM088q0VZtRzuos3nY=; b=GzDt9/VOS65W6UacGNOFpCu/lLBp40d67/9buGqDtAzrlMgkMiTciqa6sOxsp//mOq xBAdTWEToGLam52e7xIgp7xVspLa7iCqouivyNcT88gMu2avsZIR4wNBNMfpdxspLXZR hfDZBKLhHcqXCp1MR7Oe0GuPr0ivlrQgByDoAR4z9q7857xUWVDM2pWz82FKtzWPmk1Q w4zYXemJYYPPp4jnBsppu2nelSdOI8SNsDLVwkrbB+tAIiYryMtR3LXqsQYdr0dw4ktE cdkfj2ux7Q1s0KoeJ1mtukMj+dhvhxNogtGLbF8u9vNC/i410SBXmgKLw2q8+DEs0oSK L/MQ== X-Gm-Message-State: AOJu0YzeIfW6K2JnLaNeP/dBhYKja8OJwgc7GzhejgaRMEBxZN0i7ULv sE7uFLqn5ujlHWcJ6hBiRw6LlgRVCKq8b4Kxz1p1PjYur1vMOk8XAjea X-Gm-Gg: ASbGncsY6Hz0x21GZY0vqgtjly8SuLuNzW6dzAx4sznFbnjTsqfzFbRQGdQyh9WkxAM 9vGdPWg5ZrFCxByUfeRcOMajQGryxHhCyWfwJU/5LRD5AjWamn17fAbq96Wj9HKfgeSrR4tp25J gv+8LiIxMJPLq+cX2SEK+I8Mpu/UiCU6r41cgKsNeE3vPSFyXcI9xTXFVfHrq9ApFmjAZYcdCw5 HWOXz2Jt5Egx7HpMzjWqcNSj+suoaCfR6sKIAjhsexexol8Em8/TtTtQLXKthFvSQkMDvOJ/En8 c5niUlLx4xeqE8cLVsY5u19g4j9Fm2XRmp80hg== X-Google-Smtp-Source: AGHT+IHiakJKsjMoHKQlqzoxkSsBvZ90bYOaGtlLF1t7S5ecdw+T/yG7i07cKuZPDUe3p0GtTm77iA== X-Received: by 2002:a05:6000:4022:b0:3a3:7638:d754 with SMTP id ffacd0b85a97d-3a4cb454b98mr57681f8f.21.1748019474350; Fri, 23 May 2025 09:57:54 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:4cd:3a54:76ae:1d57]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3674fed67sm22895632f8f.89.2025.05.23.09.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 May 2025 09:57:53 -0700 (PDT) From: Robert Pluim To: Anush V Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <878qn0mpwc.fsf@gmail.com> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <87ikmfvjla.fsf@gnu.org> <87y0vbt9ry.fsf@gmail.com> <87jz6tmbi2.fsf@gnu.org> <87cyckubvb.fsf@gmail.com> <87a57kw18m.fsf@gnu.org> <878qn0mpwc.fsf@gmail.com> Date: Fri, 23 May 2025 18:57:53 +0200 Message-ID: <87plfzmfhq.fsf@gmail.com> 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: 78240 Cc: 78240@debbugs.gnu.org, Xiyue Deng X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 13 May 2025 18:33:39 +0200, Robert Pluim s= aid: Robert> Hmm, I get splitting when I also set `nnimap-inbox' appropriate= ly, but Robert> it=CA=BCs all server side splitting, and it uses `nnmail-split-= methods' Robert> instead of the nnimap variable, so either I=CA=BCve got a confi= g issue or Robert> it=CA=BCs a a bug. I=CA=BCll keep looking over the next week. So I was completely wrong about how nnimap splitting is implemented: the splitting logic runs in Gnus, but all it does is move messages around on the IMAP server, so it can=CA=BCt be used in place of imap.el to download messages. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 31 11:22:08 2025 Received: (at 78240) by debbugs.gnu.org; 31 Jul 2025 15:22:08 +0000 Received: from localhost ([127.0.0.1]:49087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uhV6d-0008MO-LZ for submit@debbugs.gnu.org; Thu, 31 Jul 2025 11:22:08 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:50427) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uhV6a-0008Lg-Lb for 78240@debbugs.gnu.org; Thu, 31 Jul 2025 11:22:05 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3b79bddd604so431131f8f.0 for <78240@debbugs.gnu.org>; Thu, 31 Jul 2025 08:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753975318; x=1754580118; 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=m6t1gERWCSSVE7hKs7zpYRlcoaUQKDEuEUw6gTMUXi8=; b=L+SfrJ8A015RJLXYkt+2P5jcZPnf/Dby5jwCsP1INWzYlQBCoAO4JCD1sbJdwMF72n CLmUwtPcIMQ1jL9h9AX5hkvgD5lV9zckogbt61wINDIbdPSOw6KqGjbRz6tng9euV74f rk6J+XMP6awfA8P1887VTJS52lrKXVhHgBFaEPduN8dX6VCidWbsgatRU4ozRD7tPrMf 3R905b/fiktSSJUDzsmQZ3DZ2gIDw6lz0txQqGG1vR4+S/hYT1OERparXMiT/lmX1pnP TKZe2bOdz4qyqdLsC/AQ6H6ddB63LJSEzOQTKfqZLXXnDxxoCL+hkwhpl2ooZ7Qxj5rt V4BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753975318; x=1754580118; 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=m6t1gERWCSSVE7hKs7zpYRlcoaUQKDEuEUw6gTMUXi8=; b=O8NhLxIjKV5+No4h1bCHMmPRZvNC3sveh/Yff3lKPwHXJshueQ/WTIJE+mnD3zkNJz G4MqoCn1XdwgF3qfFdQkgX5U2Qe7jOp4zaN/ja7WCaQ6Pj3AxdAics7naygvgNTjM4cM CXgEZcviQPEusj5BW6UG/C4tEV1w1vDU+EEti2s76VFk/IMUsK8g7TeJRrHlnkXs5xuD bk79X86jL6KMs2T1cuIl3aUq3W/8jh9qnvhdnx8QOYbdyrmllYMwFJ1EacGNz8TQU60M kLXQUXPZ+m5bKgtCmV2eiw0IVo/6i6ZLXUEiWpuOO/Xz8GMDSSCazoqts4x46xlnZWLq b+5Q== X-Forwarded-Encrypted: i=1; AJvYcCWSK+EFf08qhnKZHFHMvWw8zIf+kGLaUB3AnOCtKWhUXCvZ6YJgvvZ6b5MmQJzSdv4KTEry7Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YytKPTWX1HSy7pdfVkL1xmuhR3Epw6CeSpFjGDc8borjoIUGAPK oHUSf7yRfXS8TGjOxcdfLYSPjrXzSqzFgshQWrhW/5F3s3ZqLVWGlyC11FEznQ== X-Gm-Gg: ASbGncte26xDZBgbeY5csCuNIS1DkvZGbsY/uJeEexTF/qhV/5NZzebuclSKEEICPMK s6Q+CJ6DOaFCRUY8C1FMyDTF3bFoJbg6wgDyq6sVl4lypBQU9brEmRS8PremFOz8no6/0qkWapR xeSjBcz8CqUi0Hr+OQF/nKmRNJgNNiaaXFMI/74cYzJq0TXSpLHK+3ZGw2O1+oF5kAOtjA2Eal+ 6236LIkEEIWoMXy3grxmuz4MdbyBzmImyJ+QQOcpzzZH902n4xf9cn2cILbIOQcKN86mcidrEyX cKyGUE9toG7eVkyu/ECm7F9sHz4u1E5cfsa3Smwmi8jW9V/w3IeyOUv1DXTYR/Y7iMmLFHxWm1q aHGzE54fi0g== X-Google-Smtp-Source: AGHT+IHKOdrQxgdYtIA4NGEpoFfcMZPmJ2u9aYduOvVZDI6G98YmmlJC7XW+qpldKiOIHELfOKTJFA== X-Received: by 2002:a05:6000:2511:b0:3b7:9c79:32a6 with SMTP id ffacd0b85a97d-3b79c793525mr2053570f8f.47.1753975317978; Thu, 31 Jul 2025 08:21:57 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:dd92:9d19:a53b:17cf]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4589edf54bdsm32595525e9.6.2025.07.31.08.21.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 08:21:57 -0700 (PDT) From: Robert Pluim To: Xiyue Deng Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87h6206ixr.fsf@debian-hx90.lan> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> Date: Thu, 31 Jul 2025 17:21:56 +0200 Message-ID: <871ppw9yi3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78240 Cc: 78240@debbugs.gnu.org, j@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >>>>> On Sun, 04 May 2025 16:43:28 -0700, Xiyue Deng 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). Robert -- --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-auth-source-support-to-imap.el.patch >From 19901eda8b693937861d93856322f4b73a3dc231 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Mon, 28 Jul 2025 11:11:29 +0200 Subject: [PATCH] Add auth-source support to imap.el * lisp/net/imap.el: Require auth-source. (imap-use-auth-source): New user option. (auth-source-creation-prompts): New defvar. (imap-credentials): New function, performs 'auth-source' search. (imap-authenticate): Call 'imap-credentials' if no user is specified and 'imap-use-auth-source' is non-nil. * etc/NEWS: Announce the feature. --- etc/NEWS | 12 +++++ lisp/net/imap.el | 119 +++++++++++++++++++++++++++++++++-------------- 2 files changed, 96 insertions(+), 35 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index b790c7e318c..61eadc63106 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1338,6 +1338,18 @@ replies. ** Imap +--- +*** New user option 'imap-use-auth-source'. +Default t. Controls whether 'imap-authenticate' will attempt to lookup +credentials via 'auth-source' (but only when it is called with username +nil). + +--- +*** 'imap-authenticate' can now retrieve credentials via 'auth-source'. +Calling 'imap-authenticate' with username nil will now perform an +'auth-source' search in order to obtain the username and the password. +Customize 'imap-use-auth-source' to nil to prevent this. + --- *** 'imap-authenticate' can now use PLAIN authentication. "AUTH=PLAIN" support is auto-enabled if the IMAP server supports it. Pass diff --git a/lisp/net/imap.el b/lisp/net/imap.el index f705da317e5..e381b3dc95f 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -139,6 +139,8 @@ (eval-when-compile (require 'cl-lib)) (require 'utf7) (require 'rfc2104) +(require 'auth-source) + ;; Hmm... digest-md5 is not part of Emacs. ;; FIXME: Should/can we use sasl-digest.el instead? (declare-function digest-md5-parse-digest-challenge "ext:digest-md5") @@ -246,6 +248,13 @@ imap-store-password "If non-nil, store session password without prompting." :type 'boolean) +(defcustom imap-use-auth-source t + "If non-nil, lookup username and password using `auth-source'. +This only takes effect when the \"user\" passed to `imap-authenticate' +is nil." + :type 'boolean + :version "31.1") + ;;; Various variables (defvar imap-fetch-data-hook nil @@ -1107,6 +1116,26 @@ imap-ping-server (imap-ok-p (imap-send-command-wait "NOOP" buffer)) (error nil))) +(defvar auth-source-creation-prompts) + +;; Stolen from, uhm, "inspired by" nnimap.el. +;; We don't want to drag in the whole of nnimap. +(defun imap-credentials (address ports user) + (let* ((auth-source-creation-prompts + '((user . "imap: username for %h: ") + (secret . "imap: password for %u: "))) + (found (nth 0 (auth-source-search :max 1 + :host address + :port ports + :user user + :require '(:user :secret) + :create t)))) + (if found + (list (plist-get found :user) + (auth-info-password found) + (plist-get found :save-function)) + nil))) + (defun imap-authenticate (&optional user passwd buffer) "Authenticate to server in BUFFER, using current buffer if nil. It uses the authenticator specified when opening the server. @@ -1117,41 +1146,61 @@ imap-authenticate user for a username and/or password." (with-current-buffer (or buffer (current-buffer)) (if (not (eq imap-state 'nonauth)) - (or (eq imap-state 'auth) - (eq imap-state 'selected) - (eq imap-state 'examine)) - (make-local-variable 'imap-username) - (make-local-variable 'imap-password) - (make-local-variable 'imap-last-authenticator) - (when user (setq imap-username user)) - (when passwd (setq imap-password passwd)) - (if imap-auth - (and (setq imap-last-authenticator - (assq imap-auth imap-authenticator-alist)) - (funcall (nth 2 imap-last-authenticator) (current-buffer)) - (setq imap-state 'auth)) - ;; Choose authenticator. - (let ((auths imap-authenticators) - auth) - (while (setq auth (pop auths)) - ;; OK to use authenticator? - (setq imap-last-authenticator - (assq auth imap-authenticator-alist)) - (when (funcall (nth 1 imap-last-authenticator) (current-buffer)) - (message "imap: Authenticating to `%s' using `%s'..." - imap-server auth) - (setq imap-auth auth) - (if (funcall (nth 2 imap-last-authenticator) (current-buffer)) - (progn - (message "imap: Authenticating to `%s' using `%s'...done" - imap-server auth) - ;; set imap-state correctly on successful auth attempt - (setq imap-state 'auth) - ;; stop iterating through the authenticator list - (setq auths nil)) - (message "imap: Authenticating to `%s' using `%s'...failed" - imap-server auth))))) - imap-state)))) + (or (eq imap-state 'auth) + (eq imap-state 'selected) + (eq imap-state 'examine)) + ;; .authinfo can contain symbolic or numeric ports. + (let ((ports (cond ((eq imap-port 993) + '(993 "imaps")) + ((eq imap-port 143) + '(143 "imap")) + (t imap-port))) + (imap-credentials nil) + (passwd-save-function nil)) + (make-local-variable 'imap-username) + (make-local-variable 'imap-password) + (make-local-variable 'imap-last-authenticator) + (when user (setq imap-username user)) + (when passwd (setq imap-password passwd)) + (unless (or user (not imap-use-auth-source)) + ; Don't perform auth-source + ; lookup if a user was specified + ; explicitly. + (when (setq imap-credentials (imap-credentials imap-server ports user)) + (setq imap-username (nth 0 imap-credentials) + imap-password (nth 1 imap-credentials) + passwd-save-function (nth 2 imap-credentials)))) + (if imap-auth ; It's a reauth + (and (setq imap-last-authenticator + (assq imap-auth imap-authenticator-alist)) + (funcall (nth 2 imap-last-authenticator) (current-buffer)) + (setq imap-state 'auth)) + ;; Choose authenticator. + (let ((auths imap-authenticators) + auth) + (while (setq auth (pop auths)) + ;; OK to use authenticator? + (setq imap-last-authenticator + (assq auth imap-authenticator-alist)) + (when (funcall (nth 1 imap-last-authenticator) (current-buffer)) + (message "imap: Authenticating to `%s' using `%s'..." + imap-server auth) + (setq imap-auth auth) + (if (funcall (nth 2 imap-last-authenticator) (current-buffer)) + (progn + (message "imap: Authenticating to `%s' using `%s'...done" + imap-server auth) + ;; Save the credentials if a new token was created + ;; via auth-source. + (when (functionp passwd-save-function) + (funcall passwd-save-function)) + ;; set imap-state correctly on successful auth attempt + (setq imap-state 'auth) + ;; stop iterating through the authenticator list + (setq auths nil)) + (message "imap: Authenticating to `%s' using `%s'...failed" + imap-server auth))))) + imap-state))))) (defun imap-close (&optional buffer) "Close connection to server in BUFFER. -- 2.39.5 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 05 14:01:45 2025 Received: (at 78240) by debbugs.gnu.org; 5 Aug 2025 18:01:45 +0000 Received: from localhost ([127.0.0.1]:56896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujLyr-0005pQ-1s for submit@debbugs.gnu.org; Tue, 05 Aug 2025 14:01:45 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:55798) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ujLyn-0005p8-UL for 78240@debbugs.gnu.org; Tue, 05 Aug 2025 14:01:42 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-b34a6d0c9a3so5859154a12.3 for <78240@debbugs.gnu.org>; Tue, 05 Aug 2025 11:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754416895; x=1755021695; 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=l3NidscQ+e4XFrJ+fkAMyU7tYzYI/vubrkDsGQUfEac=; b=bxX/7OYiXlnDgJIJtebr2Lncj25XE9RwJPE5MHfCzwxUcXtf+HlDOT/9fa4AHhMGIr 6mvtXaoqobQtklJAZM/4afh2nbeSWdlYnyyG1x9VqSumnvdnxzUU5c/IR6GqHZ0Ci+ju /XRMDYlBZiY04zCjQbG5hNkX1qjPRaT3x0J8IR4wt7Pa7oZyJDuCYMhizxQc4tVh5Kto Ez+Dv1G+IX4k+WWVYRpXnIc8XtHDi9yNP7rurK98Wvtc60xX59/qNjPrls6fu/WL8dQk 9kqC9tQOOflic/GQ5H9Uoe9LcE8Lc9M69+Xjyn3C2AoBFQAm0BiWwV5IVkuEQRxuMjuG wObQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754416895; x=1755021695; 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=l3NidscQ+e4XFrJ+fkAMyU7tYzYI/vubrkDsGQUfEac=; b=Q1KmeLvQJKFEv6Jh6FSX74qaSvkFhxnUbWrmncPmygaqq5gJiBRrGjip+RU5wC0/8O yN3o24UyGDNnXVTH1n628ngpMy0e/9UZdSKr1E6A5x2IVJckzgYvuMlcksFBE0oYBDnd XCmpqSL0G0c86EdR+M1qVScU6FSPfPvBJ9vpVq9b4CIVeV/OGF9XW3Qv4/pY14AgpGvB IIqOOtS/TdGOVOsF/CGDHJqzebSvQeG2xGUlTPFda0LiX9/bHCsknUpdSphgj2mGvPS5 4YOvYVhFNRjtJofYo2Sl2/Qb6g/RZYT7Hlbao/yQrG5JVjljoI3qLJlZMXbpj3M2P59v CtfA== X-Forwarded-Encrypted: i=1; AJvYcCWA4Vk2ak/pHp0q7NZiSpSPMMlc0qgQz9XQz5tcbZI17l2ZH0CnPE4YpiWKrUrAmElp+o8PtA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxvcxnumNw5j4NSgZAwt9uG8g8cDkA9SfKRjS2HKMK/DYR0A+Mv P6yAUfPeNouUxzMJdwNjOug8sDecxW8xsP5h4T3JcXWbl8NYARPs2k3BO2KpZw== X-Gm-Gg: ASbGncsolObyncf89+sa7S58r9MJ4NU2pxY9cfPY7jbNS5GoOXzQAf0PxZLKkqF8OJv JfOP5jH2WCk2UVlRYc6bSuf/AhlPGDJJIYGNQ3FGgey0Pz2DLOyRUERncDykPrXETVsi2oHYQla RfIfWhMfmRwbuJkQg9pUutGD+qEVHP3VhXxGCXvfGGaRhX0oY/StYCaXDYkAg2eyZnO1Fkx392L SIgoTelGOwV48iVV8J8vsr4iI3G6XqNE3MSVMsGl35inG/CnCxpk7FDRBOaW3kMr2FBqdPfmRmu ngf5K3OhgXrsSdIa3HFE+5JI3n/wSdIVaYHLXINeQG4yCk7LExNaKqUZE6Mlljx9n7Lxui2s84A /J14kRVoRVIGRJbhHleUqiraKfdN8GktMV+p6rYESFB4sIY0F0nJzkhSY X-Google-Smtp-Source: AGHT+IFehJy/dCyVfvGiDDK43BRc2s+hlpvAlsQHPLW76gDTOg+z+hc/UzqMXs55YbnjHlxHfWDiVw== X-Received: by 2002:a17:90b:1648:b0:31e:fe0d:f48f with SMTP id 98e67ed59e1d1-321161ec3a6mr20512422a91.10.1754416894750; Tue, 05 Aug 2025 11:01:34 -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-b422b7e21adsm11512967a12.26.2025.08.05.11.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Aug 2025 11:01:31 -0700 (PDT) From: Xiyue Deng To: Robert Pluim Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <871ppw9yi3.fsf@gmail.com> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <871ppw9yi3.fsf@gmail.com> User-Agent: Notmuch/0.39 (https://notmuchmail.org) Emacs/30.1 (x86_64-pc-linux-gnu) Date: Tue, 05 Aug 2025 11:01:25 -0700 Message-ID: <87zfcd4phm.fsf@debian-hx90.lan> 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: 78240 Cc: 78240@debbugs.gnu.org, j@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Robert, Robert Pluim writes: >>>>>> On Sun, 04 May 2025 16:43:28 -0700, Xiyue Deng s= aid: > > > Xiyue> I have only tested using Gnus with nnimap (see documentation a= t [1] or > Xiyue> [2]) where you want to add `(nnimap-authenticator xoauth2)' to= your > Xiyue> `nnimap' settings. I haven't tested with `mail-sources', whic= h seems to > Xiyue> work differently compared to nnimap, and hence the implementat= ion may be > Xiyue> missing. I probably need to understand how `mail-sources' wor= ks 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). > Thanks for implementing this! As I haven't used imap.el I cannot test this right now. I'll try to find some time to set up such an account and report back. Hopefully this won't take too long. > Robert > --=20 > > From 19901eda8b693937861d93856322f4b73a3dc231 Mon Sep 17 00:00:00 2001 > From: Robert Pluim > Date: Mon, 28 Jul 2025 11:11:29 +0200 > Subject: [PATCH] Add auth-source support to imap.el > > * lisp/net/imap.el: Require auth-source. > (imap-use-auth-source): New user option. > (auth-source-creation-prompts): New defvar. > (imap-credentials): New function, performs 'auth-source' search. > (imap-authenticate): Call 'imap-credentials' if no user is > specified and 'imap-use-auth-source' is non-nil. > > * etc/NEWS: Announce the feature. > --- > etc/NEWS | 12 +++++ > lisp/net/imap.el | 119 +++++++++++++++++++++++++++++++++-------------- > 2 files changed, 96 insertions(+), 35 deletions(-) > > diff --git a/etc/NEWS b/etc/NEWS > index b790c7e318c..61eadc63106 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1338,6 +1338,18 @@ replies. >=20=20 > ** Imap >=20=20 > +--- > +*** New user option 'imap-use-auth-source'. > +Default t. Controls whether 'imap-authenticate' will attempt to lookup > +credentials via 'auth-source' (but only when it is called with username > +nil). > + > +--- > +*** 'imap-authenticate' can now retrieve credentials via 'auth-source'. > +Calling 'imap-authenticate' with username nil will now perform an > +'auth-source' search in order to obtain the username and the password. > +Customize 'imap-use-auth-source' to nil to prevent this. > + > --- > *** 'imap-authenticate' can now use PLAIN authentication. > "AUTH=3DPLAIN" support is auto-enabled if the IMAP server supports it. = Pass > diff --git a/lisp/net/imap.el b/lisp/net/imap.el > index f705da317e5..e381b3dc95f 100644 > --- a/lisp/net/imap.el > +++ b/lisp/net/imap.el > @@ -139,6 +139,8 @@ > (eval-when-compile (require 'cl-lib)) > (require 'utf7) > (require 'rfc2104) > +(require 'auth-source) > + > ;; Hmm... digest-md5 is not part of Emacs. > ;; FIXME: Should/can we use sasl-digest.el instead? > (declare-function digest-md5-parse-digest-challenge "ext:digest-md5") > @@ -246,6 +248,13 @@ imap-store-password > "If non-nil, store session password without prompting." > :type 'boolean) >=20=20 > +(defcustom imap-use-auth-source t > + "If non-nil, lookup username and password using `auth-source'. > +This only takes effect when the \"user\" passed to `imap-authenticate' > +is nil." > + :type 'boolean > + :version "31.1") > + > ;;; Various variables >=20=20 > (defvar imap-fetch-data-hook nil > @@ -1107,6 +1116,26 @@ imap-ping-server > (imap-ok-p (imap-send-command-wait "NOOP" buffer)) > (error nil))) >=20=20 > +(defvar auth-source-creation-prompts) > + > +;; Stolen from, uhm, "inspired by" nnimap.el. > +;; We don't want to drag in the whole of nnimap. > +(defun imap-credentials (address ports user) > + (let* ((auth-source-creation-prompts > + '((user . "imap: username for %h: ") > + (secret . "imap: password for %u: "))) > + (found (nth 0 (auth-source-search :max 1 > + :host address > + :port ports > + :user user > + :require '(:user :secret) > + :create t)))) > + (if found > + (list (plist-get found :user) > + (auth-info-password found) > + (plist-get found :save-function)) > + nil))) > + > (defun imap-authenticate (&optional user passwd buffer) > "Authenticate to server in BUFFER, using current buffer if nil. > It uses the authenticator specified when opening the server. > @@ -1117,41 +1146,61 @@ imap-authenticate > user for a username and/or password." > (with-current-buffer (or buffer (current-buffer)) > (if (not (eq imap-state 'nonauth)) > - (or (eq imap-state 'auth) > - (eq imap-state 'selected) > - (eq imap-state 'examine)) > - (make-local-variable 'imap-username) > - (make-local-variable 'imap-password) > - (make-local-variable 'imap-last-authenticator) > - (when user (setq imap-username user)) > - (when passwd (setq imap-password passwd)) > - (if imap-auth > - (and (setq imap-last-authenticator > - (assq imap-auth imap-authenticator-alist)) > - (funcall (nth 2 imap-last-authenticator) (current-buffer)) > - (setq imap-state 'auth)) > - ;; Choose authenticator. > - (let ((auths imap-authenticators) > - auth) > - (while (setq auth (pop auths)) > - ;; OK to use authenticator? > - (setq imap-last-authenticator > - (assq auth imap-authenticator-alist)) > - (when (funcall (nth 1 imap-last-authenticator) (current-buffer)) > - (message "imap: Authenticating to `%s' using `%s'..." > - imap-server auth) > - (setq imap-auth auth) > - (if (funcall (nth 2 imap-last-authenticator) (current-buffer)) > - (progn > - (message "imap: Authenticating to `%s' using `%s'...done" > - imap-server auth) > - ;; set imap-state correctly on successful auth attempt > - (setq imap-state 'auth) > - ;; stop iterating through the authenticator list > - (setq auths nil)) > - (message "imap: Authenticating to `%s' using `%s'...failed" > - imap-server auth))))) > - imap-state)))) > + (or (eq imap-state 'auth) > + (eq imap-state 'selected) > + (eq imap-state 'examine)) > + ;; .authinfo can contain symbolic or numeric ports. > + (let ((ports (cond ((eq imap-port 993) > + '(993 "imaps")) > + ((eq imap-port 143) > + '(143 "imap")) > + (t imap-port))) > + (imap-credentials nil) > + (passwd-save-function nil)) > + (make-local-variable 'imap-username) > + (make-local-variable 'imap-password) > + (make-local-variable 'imap-last-authenticator) > + (when user (setq imap-username user)) > + (when passwd (setq imap-password passwd)) > + (unless (or user (not imap-use-auth-source)) > + ; Don't perform auth-source > + ; lookup if a user was specified > + ; explicitly. > + (when (setq imap-credentials (imap-credentials imap-server por= ts user)) > + (setq imap-username (nth 0 imap-credentials) > + imap-password (nth 1 imap-credentials) > + passwd-save-function (nth 2 imap-credentials)))) > + (if imap-auth ; It's a reauth > + (and (setq imap-last-authenticator > + (assq imap-auth imap-authenticator-alist)) > + (funcall (nth 2 imap-last-authenticator) (current-buffe= r)) > + (setq imap-state 'auth)) > + ;; Choose authenticator. > + (let ((auths imap-authenticators) > + auth) > + (while (setq auth (pop auths)) > + ;; OK to use authenticator? > + (setq imap-last-authenticator > + (assq auth imap-authenticator-alist)) > + (when (funcall (nth 1 imap-last-authenticator) (current-bu= ffer)) > + (message "imap: Authenticating to `%s' using `%s'..." > + imap-server auth) > + (setq imap-auth auth) > + (if (funcall (nth 2 imap-last-authenticator) (current-bu= ffer)) > + (progn > + (message "imap: Authenticating to `%s' using `%s'.= ..done" > + imap-server auth) > + ;; Save the credentials if a new token was created > + ;; via auth-source. > + (when (functionp passwd-save-function) > + (funcall passwd-save-function)) > + ;; set imap-state correctly on successful auth att= empt > + (setq imap-state 'auth) > + ;; stop iterating through the authenticator list > + (setq auths nil)) > + (message "imap: Authenticating to `%s' using `%s'...fa= iled" > + imap-server auth))))) > + imap-state))))) >=20=20 > (defun imap-close (&optional buffer) > "Close connection to server in BUFFER. > --=20 > 2.39.5 > =2D-=20 Regards, Xiyue Deng --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmiSRvYSHG1hbnBoaXpA Z21haWwuY29tAAoJEC3pZe1jglyTKmEP+wW+mfVG8C8agsrJoEuVqeY2iY6hnD7T 5DBaK0ooc/wSfSv65qIh0Y6bxjRFIVj6TZxEdXEj/+/+q5vPp+wu8WXWbAorH5eL HEUAWhLGbSiI72+xFgESVgKRHJGkDPKmhLIHbgJGD+Rki2g/RYY2AFevhcV8/I0g umSZqOc8P1YWvKxoNF2XmACZs/ZRPKim3MN/PDVGmvqoeH7OxiMnM+ZIc0IQYn5Q B1psD+qV/22Dsg+3FjfaAbOc8aOez2uz0pr5rT4VN8asjp4kz7pxf1rgaJrfXEuV Mr8mqOitto04+Y786jDbIx8p4X6px2umvnXYNYsM/WMN1M2sUG8cFazohKOoykHw YtlKVFaEAelSeU9AQFQ2secidU35lZNBUEqBs6efteqBdJbbDKOSHXW/Q13lyMZM roEkJbgYHUYlLRNqzdRBUz29/oMFXqQRJ9p17zf3JO/x7jvcjN1fU7dejWopQrht +B6mVhXS/0hPwegAYXAnkHsMNGYN9SD+4OpMfOdUyfrSidQcWbVdGqQ6UVKy2g/l fAGJrIfhth045D/GrVlyAnEBdUp+wH4HgHzvbTlvuuEo2VGC854ydea7KsEdwgCn L+SanYa7zYeeqNjon7xrjDKt+3iFo2VXRjH+TCnhOdVxN9VhoLoksrUSxe2rDE/3 jNg5aW1Rls3B =bN4t -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 03:56:49 2025 Received: (at 78240) by debbugs.gnu.org; 6 Aug 2025 07:56:50 +0000 Received: from localhost ([127.0.0.1]:57977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujZ0z-00036E-GM for submit@debbugs.gnu.org; Wed, 06 Aug 2025 03:56:49 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:50359) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ujZ0w-00035z-SM for 78240@debbugs.gnu.org; Wed, 06 Aug 2025 03:56:47 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3b79bddd604so4242709f8f.0 for <78240@debbugs.gnu.org>; Wed, 06 Aug 2025 00:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754467000; x=1755071800; 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=FMxPIpRxdTsDUOugqXNYXB/1dMFq/aB4V36b9d7JIPw=; b=FeTXzynjZP73DoUmmPr41R36ZEeHhVsuca8xke54SVLbBuVZvpTifBCtg7AK4Yd4lZ ginvPFTSULT++4ghQfBtglQOm7qfjWnlrlnjywakmxXvZZ/MMsOLnPrM4fdQpEK3ZJ3a ePMHYq7JNO26mB5GgWXfesSPA6RGAxOCKJunU9qAXDZ2zs2Mn2fqSw9ptoNSSyomiSeQ dtLD8iz8YSjt6bJTdeuKfHxxD4ZniUofYt9T1HOiIqTKJYPI/uzLhBtpk0J7Ln8MXmay cbkczCyJNa5GGZtTqraNNIRnkhyuFY0xwVh1GoexDe/0+G51i/ENhfw8GmV//A88hgz+ agMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754467000; x=1755071800; 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=FMxPIpRxdTsDUOugqXNYXB/1dMFq/aB4V36b9d7JIPw=; b=Q4Fb4iEbcrFW4+JfxZVqTd/BQVrpPYdrI+/oikle8IAkPXYbIQMqeYXQtqxhG2r9LB zKirj5AUA5YR/a6lFXWaTXGg4wIuJ1zEGDMZsmDlxAL2GQBsCvqJHtVC0QnjJnuoi9Tm MpcxQNxxD3ukW4NzgpKR/4zeGHaWxl5sgSchwtQeQUFx0q+9UVtWLfFyjNjhhnz24eJt X1zBGCBNtzvA+yIeciiI9QjXrAaP9H6AB4/8ujB0+VcA5UJF5pm4ksUx7CE/4SaeFG8z hNqLkFG0jO0bv22wq9NiXRFme9OXqXqEaSVF2HI+TNi+atSJdpgfSeuiPnZPreYXK5Ls B6Uw== X-Forwarded-Encrypted: i=1; AJvYcCU72bdBNDxodCcyclUVJ+GU18l1+/9gD+55owYANItcFzP8u3Hp8R6adaStX/VeFbgq829bSQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwcD1RME2flvTSPae7HqEpJGfwGa6eSG1qTn8+nXYOsPjdMYSFM dhoDOK+Urgo/pywiQImDKyty0dvej3NMGZNFK1hYJjqFmipLmhFGwlDnEifJzw== X-Gm-Gg: ASbGncsq/WGky7MzKXY7GB20tfUsybY1geHpJZZvR8e+qsfPZqC8UBUOSgbn4iDNQ5o JZC9YnJBL3fSzW7MtZT5sNhSTsNM2zV8+j0LD+oFei6jlptvxT/MOcFoZyXsEvpvJ/ATcKpdqVj smfesxH965sGFN6GSomq44wYwcrVbYsMxyXvWLEULkC2KI4iAL+FagZm3dzfkM4GeVWVWNO+JbQ t1IsYvJzR8qzxWbEmO/qDQXTVOALkOgFG66NHmWNjueCxoAw0neA4pdvU0wK2qhTERg9DAFOvrf PONQGNMEKlm08v038ewWwPtMn0mliBs39rYvmZHFeu4vEkrTJOnnrd40lwMbG0aNkT26sJ7Ut1t HL8E1q07q9g== X-Google-Smtp-Source: AGHT+IFZNL35fAntnldK8KR6TEK/oCdH2lJf7yP405Zp4a7b4Rehg4efLc/fOl9eF26l+P7KRAgHxg== X-Received: by 2002:a05:6000:2dc9:b0:3b6:c88:7b74 with SMTP id ffacd0b85a97d-3b8f41f4bdbmr1368656f8f.59.1754466999823; Wed, 06 Aug 2025 00:56:39 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:2501:3d8e:8624:63de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e87487fcsm13979445e9.3.2025.08.06.00.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Aug 2025 00:56:39 -0700 (PDT) From: Robert Pluim To: Xiyue Deng Subject: Re: bug#78240: 30.1; xoauth2 authentication fails in gnus imap mail fetching In-Reply-To: <87zfcd4phm.fsf@debian-hx90.lan> References: <87zffsbi29.fsf@gnu.org> <87h6206ixr.fsf@debian-hx90.lan> <871ppw9yi3.fsf@gmail.com> <87zfcd4phm.fsf@debian-hx90.lan> Date: Wed, 06 Aug 2025 09:56:38 +0200 Message-ID: <87zfcc7uix.fsf@gmail.com> 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: 78240 Cc: 78240@debbugs.gnu.org, j@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 05 Aug 2025 11:01:25 -0700, Xiyue Deng sa= id: Xiyue> Hi Robert, Xiyue> Robert Pluim writes: >>>>>>> On Sun, 04 May 2025 16:43:28 -0700, Xiyue Deng said: >>=20 >>=20 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 y= our Xiyue> `nnimap' settings. I haven't tested with `mail-sources', which = seems to Xiyue> work differently compared to nnimap, and hence the implementatio= n may be Xiyue> missing. I probably need to understand how `mail-sources' works= and Xiyue> extend the plugin accordingly, which could take a while. >>=20 >> Hi Xiyue, >>=20 >> I implemented auth-source lookup for imap.el (patch below). Would >> there be any chance to see if you could extend your package to suppo= rt >> xoauth2 for imap.el? >>=20 >> 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). >>=20 Xiyue> Thanks for implementing this! As I haven't used imap.el I canno= t test Xiyue> this right now. I'll try to find some time to set up such an ac= count 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=CA=BCt work, then customize `imap-log' to t before loading imap.el, and there will be an "*imap-log*" buffer containing a session trace. Robert --=20