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: Next XOAUTH2 patch: nnimap-login Date: Fri, 12 Jan 2018 21:59:01 -0800 Message-ID: <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 1515823073 379 195.159.176.226 (13 Jan 2018 05:57:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 Jan 2018 05:57:53 +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 06:57:49 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 1eaEpA-0008Ce-9E for ged-emacs-devel@m.gmane.org; Sat, 13 Jan 2018 06:57:48 +0100 Original-Received: from localhost ([::1]:41609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaEr9-00042c-OY for ged-emacs-devel@m.gmane.org; Sat, 13 Jan 2018 00:59:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaEqU-000426-Ib for emacs-devel@gnu.org; Sat, 13 Jan 2018 00:59:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaEqR-0003Vj-JR for emacs-devel@gnu.org; Sat, 13 Jan 2018 00:59:10 -0500 Original-Received: from mail-pl0-x22f.google.com ([2607:f8b0:400e:c01::22f]:46111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eaEqR-0003V9-D2 for emacs-devel@gnu.org; Sat, 13 Jan 2018 00:59:07 -0500 Original-Received: by mail-pl0-x22f.google.com with SMTP id 66so267672plc.13 for ; Fri, 12 Jan 2018 21:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=9TEpbklqamLFsA3+lbLHDnL8ChlL0qjf2o5JJG31bcA=; b=ifJE17IM2iNd/CI69UaE773dGJsYUwcJOIrqcUPd8JH814zstFKw51Z3ZskN2JtYBH N4FWbdvUxu6LQHeYfRl0CA61I+RuiBqINgCPGuLgMLwmYlAdgVACabqACgKEjLObQ5Jk 28jw+/pAQqNRzwn9bKt3BpjosBlLv2WSsjO1gNEY8rNQYYtEn5uEFIn0blkwhhTeCFxZ MdgE6LR1TBbZxMT8x2TsY/uJADtC0ui90rDR+e/uzKqXZsLP0f+tdjSL16aZAEQu8Dli qoKLok1RY7JauTqFmMv8qmhbwzKXoohkVTB+4+/nUK9jzj8B3DBba9LMeH48axn0C2Kc xTmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=9TEpbklqamLFsA3+lbLHDnL8ChlL0qjf2o5JJG31bcA=; b=FwU8ux6expasY0MVW22C4XsMbjH04V1RVO08FlkFuf4Bcgv6WYo/ZQTEcf/42f8IN6 XlKt+o71Obj4SNrD/o1jbjjvVCi9Hw6wfH5sRhSNOKIRl0DSZVoyYkoOZ6xDSmPI/0lJ NSRAWF/w1DTqAjOZYC85RVsPrkoYwv9+Mz/2OFZyZWc1tvop7/JFNgbDxfRkBvSpZg7n vjyodlHqL2XZMczp9xygm7KJzPO9xMB3zz09wfb3wrws2AQABI9Q50l6KA8eBsvLsqB9 dn11Y1tWYUPYNnM4sGGdK0VbJNPoSGxqTzbVoY3xrYJ7U563dhN18bOb5gSyUnVnJu/J tkYw== X-Gm-Message-State: AKGB3mLU0TsXSfmSBNDipO6/UmJVZU9Utd4bGtZFUIUJLFblccuRdLNB 3KTaEVy0FLOF6xZ6ewbVTiXngThV X-Google-Smtp-Source: ACJfBoubXLk8HFt48QULpI1uTIPmaAwlJS9XKMwtAvBneaIeGt8WxqsnmuEoIKANggKX+2nXXsAezw== X-Received: by 10.159.252.140 with SMTP id bb12mr29181639plb.336.1515823145398; Fri, 12 Jan 2018 21:59:05 -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 g8sm36790626pgs.55.2018.01.12.21.59.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jan 2018 21:59:04 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22f 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:221912 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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/X9qSDfQj2EFAlpZoCUACgkQ/X9qSDfQ j2G+7wv9FhCPHPhtMNfRyZQd+wGLDoU+4fcj3m816g5R40NTZbL3TLFQURJOdOtg RJapZi2ibK+KDA0x8GrbKNBuTk0GloNnJzpeYMw0mcTF7akwGKXXRAeYGGNgWdHV XHr0AEJM4sjKPHmZ5+CHWfS0bQQFuX8lzmFIKeJvteRirOJ2KwH4N3Ufg2rA23js b5poleF5WsrQW1L2KLe3DXR8Ni8HgFK5kZx7Mqm14zdHfnpM3E49DXIUhIAzdE2U jXb0uqkjoK0UH8NC8n1PEruijAu0J8AmBCEdwZzEZVz2Wws5TAB582bXjC/Cx3NC /F17wEEQ0pQxalqRuH72GFpoTMHP4V0QYBuFBE1fKLKmXmytRILkzmwOWjwWyvFd IKo8HOnRBU3C/zImEMCdBaS6y6ZB225nEPitNjDR+W4tYsDZgVwvMqzBRvxCalQp R9jvy1FcblFijiOteHYq0wGaswnsrkBV1f7ygrT4j3QaAtZrI3uVOBDj6rlgmGCL C6Scvyl0 =/MdB -----END PGP SIGNATURE----- --=-=-=--