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: Any interest in an XOAUTH2 patch for smtpmail (Gmail 2-factor auth)? Date: Sun, 07 Jan 2018 10:49:07 -0800 Message-ID: <87tvvx33oc.fsf@gmail.com> References: <87373j4tcf.fsf@gmail.com> <87wp0u2ntv.fsf@gmail.com> <87vagd395a.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 1515351004 8427 195.159.176.226 (7 Jan 2018 18:50:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 Jan 2018 18:50:04 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.3.1 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 07 19:50:00 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 1eYG0x-00012I-Ba for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2018 19:49:47 +0100 Original-Received: from localhost ([::1]:34493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYG2v-0007UY-6c for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2018 13:51:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYG2K-0007UD-2s for emacs-devel@gnu.org; Sun, 07 Jan 2018 13:51:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYG2H-0003vL-1Q for emacs-devel@gnu.org; Sun, 07 Jan 2018 13:51:12 -0500 Original-Received: from mail-pg0-x230.google.com ([2607:f8b0:400e:c05::230]:35410) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYG2G-0003ui-RS for emacs-devel@gnu.org; Sun, 07 Jan 2018 13:51:08 -0500 Original-Received: by mail-pg0-x230.google.com with SMTP id d6so3028379pgv.2 for ; Sun, 07 Jan 2018 10:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=yNyVBv/fj/oAj8qaIkzUPg6ZkpjpAAi0VJY3rSqCZ1g=; b=k0TG+rc+7yLZm+n/w3Uulq52gSxNdnNwvpdFHiqaCaue1HVOAIP8YnLruWGoBq0sgC HA65nFBzcyYJwiEYmlWuqV4AqPfhbYEbbT6QgbmFjj9e/P5MwhHIvPyHQY5z9LYKyJQh DFBPSg8fZILuM11deYL69W+lwWFiAtI0mQXFwiPZ/7AeUilCMt1TNht7DUPEdQlKzoRH CdF7I9Q5uj9KToF2+SU1kcXcZBNMNQ2Ol7NTckWAiXB2A0P03I4Julz2qZ0HV3IuAUUs iQ+Bqd4QyI3bDjPRUNyZzXZ1nc7C0tAgsM2qXNcD/iRnIZRTMkNYonXZMjBVRr80ocvY MKwg== 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:cc:subject :in-reply-to:date:message-id:mime-version; bh=yNyVBv/fj/oAj8qaIkzUPg6ZkpjpAAi0VJY3rSqCZ1g=; b=R9CZ99yReOAd+8n1Be+o9Jcvtxx48eMo+MjDAucSPz11i2EFFiWLkeFUp22ftxP7UM ySIkGTKgyf7UPv8WQvVJIMsMvhujoJBWN7KDH9aip0lV5KAO0SeVV1wu+2lWKl8INXde dkPDWFWzo7YNqY5V9s06jiU1xQfon9kkcSzcPiyZrDUsxS6skvKiqTb9/RaLc43hSL8/ F7cn567ddHaT0owKCsa9WDMdffPV6/Hq0vIbaCsfjnBoE0wLIeQ4F5irjP/b6Z21eYqU PathmkwPYojkFXD6/AOAFZnY3Kipfudq7Qn9wnmhkyew+Lr53ALDPI77KWIo6MlCJfJA pYAg== X-Gm-Message-State: AKGB3mIdYSHyx1lcWVdpOwGEslGMeytPT42myUQV81/cKXBQ0f+Z0Pwl JRrSku2FCQxCpCho96QClkbN8gIB X-Google-Smtp-Source: ACJfBovVyAiifoaEqb5GB9cMIPr52IrLiefwHYyAEXjiOAPqnFj+xwgJFng9IABf+MTZaHwjMqSt/g== X-Received: by 10.101.70.6 with SMTP id v6mr7799380pgq.249.1515351067263; Sun, 07 Jan 2018 10:51:07 -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 b78sm23303147pfc.21.2018.01.07.10.51.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Jan 2018 10:51:06 -0800 (PST) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::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:221686 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun 07 Jan 2018 at 17:42, Stefan Monnier wrote: >> A proper generalization of 'smtp-try-auth-method' is easy, of >> course. All you need is to split the test into functions, eg >> 'smtp-try-plain-auth-method', 'smtp-try-login-auth-method', etc, and >> then have 'smtp-try-auth-method' simply call >> 'smtp-try--auth-method.' Then anybody would be able to define >> their own and just add them to the 'smtpmail-auth-supported' list. > > How 'bout just making smtpmail-try-auth-method into a generic function, > so you can do > > (cl-defmethod smtpmail-try-auth-method > (process (mech (eql xoauth2)) user password) > ...) Sure, that works too, and is arguably better. I don't see many of those around, so I assumed that the "hardcoded function name convention" was the "Emacs way" (see, for example, auth-source itself). I can probably work on making that happen some time this week if there are no objections. =2D-=20 Cesar Crusius --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCAAdFiEEsu/ErKn7yEV7E0FU/X9qSDfQj2EFAlpSa6MACgkQ/X9qSDfQ j2GGZQwAokD7E3sglY/+7doBGPZfwaXvS0+RYCrmY2X2ftErRwSV+6AcyMPGmhB1 mufuoZ+6MHRdmH6qTDW1BBHOn9UUzlJtnAfR3eocVaPmjZocPJFOBTTcvrskJlqu edoneDHKjCwUnGVxEmWfBVrb3jfL9o92Q6Ea210yK1yOZcoiG45A9Ao5oDycOSjM /ntJuwwIYiAXvzlteExrO4h9u0RbS2Svv9OVSrMP37ZZn224h/dXKUlsMpGYLsOd 9DS6toMr0NSCXFpVcdzBbJvqzEueFR90AnozPOuhsadMFWrQ4LmxLmBtwODxIArV 9wEQ3BMt8qOyK2Gg1PUsqTZaLat1Bbn3FMtbeE9Iy2ewHLypUKXIUFdcbm6aazAq C7TRmCrbYEGoflLvwh8cUj+7T9LbThfxY1XJYvudi8VzCEKlTmxkuNwu5S3lvPOs 6kiVFQBI6TlY8nvq06fq071k1fGZ6I1yK0OJpuqTz+td05ifREvtKhw14Y8GZBTW 0Jczoz60 =rUzf -----END PGP SIGNATURE----- --=-=-=--