emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Next XOAUTH2 patch: nnimap-login


From: Cesar Crusius
Subject: Next XOAUTH2 patch: nnimap-login
Date: Fri, 12 Jan 2018 21:59:01 -0800
User-agent: mu4e 0.9.18; emacs 25.3.1

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=XOAUTH2")
         (nnimap-capability "SASL-IR"))
    (nnimap-command
     (concat "AUTHENTICATE XOAUTH2 "
             (base64-encode-string
              (concat "user=" user "\1auth=Bearer " password "\1\1")
              t)))))

Opinions?

-- 
Cesar Crusius

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]