summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--widgets/account-wizard.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go
index 010d82d..3d9cfd4 100644
--- a/widgets/account-wizard.go
+++ b/widgets/account-wizard.go
@@ -105,7 +105,12 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
 		wizard.smtpUri()
 	})
 	wizard.imapServer.OnChange(func(_ *ui.TextInput) {
-		wizard.smtpServer.Set(wizard.imapServer.String())
+		imapServerURI := wizard.imapServer.String()
+		smtpServerURI := imapServerURI
+		if strings.HasPrefix(imapServerURI, "imap.") {
+			smtpServerURI = strings.Replace(imapServerURI, "imap.", "smtp.", 1)
+		}
+		wizard.smtpServer.Set(smtpServerURI)
 		wizard.imapUri()
 		wizard.smtpUri()
 	})