From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Cesar Crusius Newsgroups: gmane.emacs.devel Subject: Re: Next XOAUTH2 patch: nnimap-login Date: Sat, 13 Jan 2018 10:17:48 -0800 Message-ID: <87zi5hfws3.fsf@gmail.com> References: <87wp0m1eqi.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1515867403 3315 195.159.176.226 (13 Jan 2018 18:16:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 Jan 2018 18:16:43 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.3.1 To: "emacs-devel\@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 13 19:16:39 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaQMA-0000TX-Fb for ged-emacs-devel@m.gmane.org; Sat, 13 Jan 2018 19:16:38 +0100 Original-Received: from localhost ([::1]:54812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaQO9-00022x-7a for ged-emacs-devel@m.gmane.org; Sat, 13 Jan 2018 13:18:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaQNS-00022M-5H for emacs-devel@gnu.org; Sat, 13 Jan 2018 13:17:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaQNP-0004eR-0v for emacs-devel@gnu.org; Sat, 13 Jan 2018 13:17:58 -0500 Original-Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:33582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eaQNO-0004dh-QF for emacs-devel@gnu.org; Sat, 13 Jan 2018 13:17:54 -0500 Original-Received: by mail-pf0-x230.google.com with SMTP id t5so186133pfi.0 for ; Sat, 13 Jan 2018 10:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:in-reply-to:date:message-id :mime-version; bh=Swy5Ak91Af2Z/em4o1QRuq/yAIAjZ8DpJyt76auEWBI=; b=M4uEqHuaSmyisY0NsaFQ/8uXn725fXBbGThp62MlCDB5vXTVCuEsGLPfrKnvnNLJrv r81K7riq/eVLNiNY/acF7qQ0K2a6k8K9TD1xRQ684LujJjm7catgte+8BRbS7QajnCNz dM3r1haLKMEa2mTcyyay0lEoXPs86jIz5D8o/APi2+d+67BgzQheAsnIbHGA8/9vjUX4 UjPzr1JbEO9bLwiHVnwO6VXXrtod61kr9hXtS28xDcDqcT8EkXqCXti6rLKC5vc06BrQ i0KTW1FiZv28KMLZbJ/ffN14HoDUdJ/hnEewN2DzRdQO/GEtH3cFFkBNJawMOCyaF7yO flzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject :in-reply-to:date:message-id:mime-version; bh=Swy5Ak91Af2Z/em4o1QRuq/yAIAjZ8DpJyt76auEWBI=; b=JEXjgFYwP01G/aOpQGStbXoHNCrnvM8s++EWfZ4OZdWwKqZ5dU89cTI0nKyTXsv2AN ICcSAZ7ozZrzHFTdbMp0j2oWk18B+ianjkjer9nIYBHvIfNYqoMyWkzdt/rkVuj4Q4os 2HvUQl/ukKLcVTzdsL3kcn8QsA/prLAFndtlnlRGLOVm1RDIZdLt6hi43D2XS4tBc0ri Yty+aTg29zamQLVIYd4TcBl6J2YrzWEANGmdWXMLhezefMDUFtbeSz+neGO+ORFNG3u4 /6zkxQuxnt2dyKIZ8FR13p5bYK1239PIhFgZAUYve3CgZ5h28/aCqd/FMfICt74cSuwx DWvw== X-Gm-Message-State: AKGB3mLQ0Z9xpNHzkHixqoGpqdpney2VS/mY/AZ+kmsmOBN8zcRCOIls B6rdEHhbsZNpJ9o5hwxtfFha9a4b X-Google-Smtp-Source: ACJfBovJj10yXexr0qKxOsTs87CN1H9L/3gX3HSxQgFW2nKrXC+aQyjawUQell+LjBvW/FPFgzlT3A== X-Received: by 10.99.100.131 with SMTP id y125mr18953286pgb.359.1515867473135; Sat, 13 Jan 2018 10:17:53 -0800 (PST) Original-Received: from cesars-w520 (c-24-4-33-27.hsd1.ca.comcast.net. [24.4.33.27]) by smtp.gmail.com with ESMTPSA id 63sm23801615pft.11.2018.01.13.10.17.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Jan 2018 10:17:52 -0800 (PST) In-reply-to: <87wp0m1eqi.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221930 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Let me reply to my own question: Better not to do anything: not only the smtpmail patch is probably a year a= way from deployment, but there are changes in auth-pass in Emacs 26 that make dealing with all the possible combinations awkward. What I'm going to do is to get the auth-source-xoauth2 package ready and working, at this point, strictly through advises, and using the MELPA auth-password-store package instead of the one included in Emacs 26. Once things settle down we can talk more patches. On Sat 13 Jan 2018 at 05:59, Cesar Crusius wrote: > Hi all, > > Now that the patch is in for smtpmail-try-auth-method, my (yet not > submitted) auth-source-xoauth2 package allows me to send e-mail through > Gmail using XOAuth2. The next piece of the puzzle is reading e-mail, and > the needed patch is now in nnimap-login. I have it working by advising > it, but I am thinking that nnimap-login maybe should have the same > extensibility as its "mirror" smtpmail. > > This function seems harder to generalize - one of the ways would be to > make the entire `cond' body a list that can be added to, and then turn > it into > > (defmacro nnimap-login (user password) > `(cond ,@nnimap-login-methods)) > > or something like that. With that, adding support for a protocol could > be done with > > (add-to-list 'nnimap-login-methods > '((and (eq nnimap-authenticator 'xoauth2) > (nnimap-capability "AUTH=3DXOAUTH2") > (nnimap-capability "SASL-IR")) > (nnimap-command > (concat "AUTHENTICATE XOAUTH2 " > (base64-encode-string > (concat "user=3D" user "\1auth=3DBearer " password "\1\1") > t))))) > > Opinions? =2D-=20 Cesar Crusius --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCAAdFiEEsu/ErKn7yEV7E0FU/X9qSDfQj2EFAlpaTUwACgkQ/X9qSDfQ j2Hc9Av+NwJgUzZq8s14YrqbtRtu1M+2/pYAd6Fim/EqNQPEEN//CMO8dkdimg/N NSTPZBONKq+o1wonPWReZ0bCk6CaypqJQez8zeWQoltEH0RAbJnqwyaipp/3dcw8 AoGBbYiivIw/wDUuqN+Gq6+UCwEnAJdQTDMk2QB8BpD275oa/z1VxFItd0XVOJjc esN1bM6WqbRwsMGOaj69DfSTnzlQNlV6gUfhiH2CfhYcrw19kbWWq+BQ9tlDJmPd en9INSkwMkmyZUBj6S9QiaBuKzqEjkuiUgD9CGnFM+DKOYRHkGMNcDJCTQ0k2yxC s0me/4rroX4tuUpfeeOLD8x9aC2mS/FCrkVDC+nWqWZM8HzQDlRd5xH/tRyqkjYd tbbRQlRoYuRnXGYw51zl7KecbOBjQVSb3oj27Wh7ogum1XLJaB51koY3tXs8O7iV E40jFNfUSYjlNh+ZvxFp13Y0ZjXP638ir+pbla85zdL9jWFVZUFYlsyBMKBbbzel PBxRGwE4 =AjCY -----END PGP SIGNATURE----- --=-=-=--