diff options
author | Marcin Serwin <marcin.serwin0@protonmail.com> | 2023-03-14 10:42:49 +0000 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-03-26 20:44:56 +0200 |
commit | c09b17a930cc58c13dd5dd2ba8e7a261833eb05a (patch) | |
tree | 3d876bd91e3d0c463e8bb79129dfeb09cef16fd2 /widgets/account-wizard.go | |
parent | 6d59ad3f02bc97c0b5040f59259fa8450702a2e2 (diff) | |
download | aerc-c09b17a930cc58c13dd5dd2ba8e7a261833eb05a.tar.gz |
smtp: replace smtp-starttls with schema option
The "smtp-starttls" options is now ignored in favor of more detailed
schema specification, similarly to IMAP.
Fixes: https://todo.sr.ht/~rjarry/aerc/149
Signed-off-by: Marcin Serwin <marcin.serwin0@protonmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets/account-wizard.go')
-rw-r--r-- | widgets/account-wizard.go | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go index c1d237ef..60497f83 100644 --- a/widgets/account-wizard.go +++ b/widgets/account-wizard.go @@ -99,11 +99,11 @@ func NewAccountWizard(aerc *Aerc) *AccountWizard { fullName: ui.NewTextInput("", config.Ui).Prompt("> "), imapPassword: ui.NewTextInput("", config.Ui).Prompt("] ").Password(true), imapServer: ui.NewTextInput("", config.Ui).Prompt("> "), - imapStr: ui.NewText("imaps://", config.Ui.GetStyle(config.STYLE_DEFAULT)), + imapStr: ui.NewText("Connection URL: imaps://", config.Ui.GetStyle(config.STYLE_DEFAULT)), imapUsername: ui.NewTextInput("", config.Ui).Prompt("> "), smtpPassword: ui.NewTextInput("", config.Ui).Prompt("] ").Password(true), smtpServer: ui.NewTextInput("", config.Ui).Prompt("> "), - smtpStr: ui.NewText("smtps://", config.Ui.GetStyle(config.STYLE_DEFAULT)), + smtpStr: ui.NewText("Connection URL: smtps://", config.Ui.GetStyle(config.STYLE_DEFAULT)), smtpUsername: ui.NewTextInput("", config.Ui).Prompt("> "), } @@ -513,10 +513,7 @@ func (wizard *AccountWizard) finish(tutorial bool) { sec.NewKey("source", wizard.imapUrl.String()) //nolint:errcheck // can't fail. option shadowing is not enabled and the key is not empty sec.NewKey("outgoing", wizard.smtpUrl.String()) //nolint:errcheck // can't fail. option shadowing is not enabled and the key is not empty sec.NewKey("default", "INBOX") //nolint:errcheck // can't fail. option shadowing is not enabled and the key is not empty - if wizard.smtpMode == SMTP_STARTTLS { - sec.NewKey("smtp-starttls", "yes") //nolint:errcheck // can't fail. option shadowing is not enabled and the key is not empty - } - sec.NewKey("from", fmt.Sprintf("%s <%s>", //nolint:errcheck // can't fail. option shadowing is not enabled and the key is not empty + sec.NewKey("from", fmt.Sprintf("%s <%s>", //nolint:errcheck // can't fail. option shadowing is not enabled and the key is not empty wizard.fullName.String(), wizard.email.String())) if wizard.copySent { sec.NewKey("copy-to", "Sent") //nolint:errcheck // can't fail. option shadowing is not enabled and the key is not empty @@ -547,11 +544,6 @@ func (wizard *AccountWizard) finish(tutorial bool) { Source: sec.Key("source").String(), Outgoing: config.RemoteConfig{Value: sec.Key("outgoing").String()}, } - if wizard.smtpMode == SMTP_STARTTLS { - account.Params = map[string]string{ - "smtp-starttls": "yes", - } - } if wizard.copySent { account.CopyTo = "Sent" } @@ -635,11 +627,11 @@ func (wizard *AccountWizard) smtpUri() url.URL { var scheme string switch wizard.smtpMode { case SMTP_OVER_TLS: - scheme = "smtps+plain" + scheme = "smtps" case SMTP_STARTTLS: - scheme = "smtp+plain" + scheme = "smtp" case SMTP_INSECURE: - scheme = "smtp+plain" + scheme = "smtp+insecure" } var ( userpass *url.Userinfo |