From db5efa4c6cb852a0ed7b66f00d1384488b24d5fb Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sun, 20 Aug 2023 21:39:34 +0200 Subject: wizard: add oauth & xoauth options These may be needed for some users. Signed-off-by: Robin Jarry Reviewed-by: Tristan Partin Tested-by: Tim Culverhouse --- widgets/account-wizard.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go index 835cb26a..87892e38 100644 --- a/widgets/account-wizard.go +++ b/widgets/account-wizard.go @@ -154,6 +154,8 @@ const ( SMTP = "SMTP" // transports SSL_TLS = "SSL/TLS" + OAUTH = "SSL/TLS+OAUTHBEARER" + XOAUTH = "SSL/TLS+XOAUTH2" STARTTLS = "STARTTLS" INSECURE = "Insecure" ) @@ -161,7 +163,7 @@ const ( var ( sources = []string{IMAP} outgoings = []string{SMTP} - transports = []string{SSL_TLS, STARTTLS, INSECURE} + transports = []string{SSL_TLS, OAUTH, XOAUTH, STARTTLS, INSECURE} ) func NewAccountWizard(aerc *Aerc) *AccountWizard { @@ -549,6 +551,10 @@ func (wizard *AccountWizard) sourceUri() url.URL { scheme = "imap" case INSECURE: scheme = "imap+insecure" + case OAUTH: + scheme = "imaps+oauthbearer" + case XOAUTH: + scheme = "imaps+xoauth2" default: scheme = "imaps" } @@ -569,6 +575,10 @@ func (wizard *AccountWizard) outgoingUri() url.URL { var scheme string if wizard.outgoingProtocol.Selected() == SMTP { switch wizard.outgoingTransport.Selected() { + case OAUTH: + scheme = "smtps+oauthbearer" + case XOAUTH: + scheme = "smtps+xoauth2" case INSECURE: scheme = "smtp+insecure" case STARTTLS: -- cgit