From 6f4e38d129ffaf469d40fc8596d3957ee94d21e9 Mon Sep 17 00:00:00 2001 From: AJ Moon Date: Mon, 31 Jul 2017 08:15:01 -0700 Subject: [GH-6366] Add functionality to disable Authentication when connecting to SMTP (#6639) * Issue #6366: Add feature to disable auth for Encrypted connections to SMTP settings. * Clean PLAIN AUTH Option * Reorder SMTP server setup and change helptext * remove unneeded setting and modify logic * text description change --- model/config.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'model') diff --git a/model/config.go b/model/config.go index a1af59185..02af64477 100644 --- a/model/config.go +++ b/model/config.go @@ -262,6 +262,7 @@ type EmailSettings struct { FeedbackName string FeedbackEmail string FeedbackOrganization *string + EnableSMTPAuth *bool SMTPUsername string SMTPPassword string SMTPServer string @@ -785,6 +786,19 @@ func (o *Config) SetDefaults() { *o.EmailSettings.EmailBatchingInterval = EMAIL_BATCHING_INTERVAL } + if o.EmailSettings.EnableSMTPAuth == nil { + o.EmailSettings.EnableSMTPAuth = new(bool) + if o.EmailSettings.ConnectionSecurity == CONN_SECURITY_NONE { + *o.EmailSettings.EnableSMTPAuth = false + } else { + *o.EmailSettings.EnableSMTPAuth = true + } + } + + if o.EmailSettings.ConnectionSecurity == CONN_SECURITY_PLAIN { + o.EmailSettings.ConnectionSecurity = CONN_SECURITY_NONE + } + if o.EmailSettings.SkipServerCertificateVerification == nil { o.EmailSettings.SkipServerCertificateVerification = new(bool) *o.EmailSettings.SkipServerCertificateVerification = false -- cgit v1.2.3-1-g7c22