[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:
AJ Moon
2017-07-31 08:15:01 -07:00
committed by Christopher Speller
parent cf32b59e64
commit 6f4e38d129
6 changed files with 88 additions and 75 deletions

View File

@@ -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