mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[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
This commit is contained in:
committed by
Christopher Speller
parent
cf32b59e64
commit
6f4e38d129
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user