ENH make oauth work with multiple accounts

This commit is contained in:
Nathan Dwarshuis 2020-11-11 00:24:32 -05:00
parent 79957daf1c
commit 682e5621cf
1 changed files with 7 additions and 3 deletions

View File

@ -3710,9 +3710,13 @@ The following will only run if the =mu= command is found (which it won't be if t
(shell-command-to-string)))
(defun nd/xoauth2-get-secrets (host user port)
(when (and (string= host "smtp.office365.com")
(string= user "ndwarshuis3@gatech.edu")
(string= port "587"))
(when
(or (and (string= host "smtp.office365.com")
(string= user "ndwarshuis3@gatech.edu")
(string= port "587"))
(and (string= host "smtp.gmail.com")
(string= user "natedwarshuis@gmail.com")
(string= port "587")))
(list :token-url (nd/lookup-oauth-secret "token_url" user)
:client-id (nd/lookup-oauth-secret "client_id" user)
:client-secret (nd/lookup-oauth-secret "client_secret" user)