From e29e1637370ad95e4ca9f861c25d366b74829dcc Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 11 Aug 2021 21:42:58 +0100 Subject: Improve SMTP authentication and Fix user creation bugs (#16612) * Improve SMTP authentication, Fix user creation bugs and add LDAP cert/key options This PR has two parts: Improvements for SMTP authentication: * Default to use SMTPS if port is 465, and allow setting of force SMTPS. * Always use STARTTLS if available * Provide CRAM-MD5 mechanism * Add options for HELO hostname disabling * Add options for providing certificates and keys * Handle application specific password response as a failed user login instead of as a 500. Close #16104 Fix creation of new users: * A bug was introduced when allowing users to change usernames which prevents the creation of external users. * The LoginSource refactor also broke this page. Close #16104 Signed-off-by: Andrew Thornton --- templates/admin/auth/edit.tmpl | 53 +++++++++++++++++++++++------------ templates/admin/auth/new.tmpl | 12 -------- templates/admin/auth/source/ldap.tmpl | 6 ++++ templates/admin/auth/source/smtp.tmpl | 24 ++++++++++++++++ templates/admin/user/edit.tmpl | 4 +-- templates/admin/user/new.tmpl | 2 +- 6 files changed, 68 insertions(+), 33 deletions(-) (limited to 'templates/admin') diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 2b499c7c76..109186a178 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -44,6 +44,12 @@ +
+
+ + +
+
{{if .Source.IsLDAP}}
@@ -173,6 +179,30 @@
+
+
+ + +
+

{{.i18n.Tr "admin.auths.force_smtps_helper"}}

+
+
+
+ + +
+
+
+ + +

{{.i18n.Tr "admin.auths.helo_hostname_helper"}}

+
+
+
+ + +
+
@@ -308,26 +338,13 @@

{{.i18n.Tr "admin.auths.sspi_default_language_helper"}}

{{end}} - -
-
- - -
-
-
-
- - -
-
{{if .Source.IsLDAP}} -
-
- - +
+
+ + +
-
{{end}}
diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl index 6addc50d09..ba1f145a4a 100644 --- a/templates/admin/auth/new.tmpl +++ b/templates/admin/auth/new.tmpl @@ -54,18 +54,6 @@
-
-
- - -
-
-
-
- - -
-
diff --git a/templates/admin/auth/source/ldap.tmpl b/templates/admin/auth/source/ldap.tmpl index 0b7ad7a4da..295e001cf4 100644 --- a/templates/admin/auth/source/ldap.tmpl +++ b/templates/admin/auth/source/ldap.tmpl @@ -20,6 +20,12 @@
+
+
+ + +
+
diff --git a/templates/admin/auth/source/smtp.tmpl b/templates/admin/auth/source/smtp.tmpl index 670c4b3b50..b0f643b8ca 100644 --- a/templates/admin/auth/source/smtp.tmpl +++ b/templates/admin/auth/source/smtp.tmpl @@ -20,6 +20,30 @@
+
+
+ + +

{{.i18n.Tr "admin.auths.force_smtps_helper"}}

+
+
+
+
+ + +
+
+
+ + +

{{.i18n.Tr "admin.auths.helo_hostname_helper"}}

+
+
+
+ + +
+
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 5e5bc75c96..60cd8ad523 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -17,13 +17,13 @@
diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl index a433c5a7cc..d454d1cd98 100644 --- a/templates/admin/user/new.tmpl +++ b/templates/admin/user/new.tmpl @@ -19,7 +19,7 @@
-- cgit v1.2.3