summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorAJ Moon <moonmeister@users.noreply.github.com>2017-07-31 08:15:01 -0700
committerChristopher Speller <crspeller@gmail.com>2017-07-31 08:15:01 -0700
commit6f4e38d129ffaf469d40fc8596d3957ee94d21e9 (patch)
tree72e90090bc46dee66b84a12d026fc3764c702a2d /model
parentcf32b59e645bbba562485606be7fbc5cd2fede30 (diff)
downloadchat-6f4e38d129ffaf469d40fc8596d3957ee94d21e9.tar.gz
chat-6f4e38d129ffaf469d40fc8596d3957ee94d21e9.tar.bz2
chat-6f4e38d129ffaf469d40fc8596d3957ee94d21e9.zip
[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
Diffstat (limited to 'model')
-rw-r--r--model/config.go14
1 files changed, 14 insertions, 0 deletions
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