aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-08-20 21:39:34 +0200
committerRobin Jarry <robin@jarry.cc>2023-08-26 21:41:05 +0200
commitdb5efa4c6cb852a0ed7b66f00d1384488b24d5fb (patch)
treed9faa32113e61d1d4d055a977c9ca6f094d9b6d4
parentaca324e17f83170170724369a9dfe822d01ee052 (diff)
downloadaerc-db5efa4c6cb852a0ed7b66f00d1384488b24d5fb.tar.gz
aerc-db5efa4c6cb852a0ed7b66f00d1384488b24d5fb.zip
wizard: add oauth & xoauth options
These may be needed for some users. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
-rw-r--r--widgets/account-wizard.go12
1 files changed, 11 insertions, 1 deletions
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: