mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-26 21:27:40 -05:00
PLT-5904 (Server): Config flag for SMTP Cert Check. (#5857)
This commit is contained in:
+3
-2
@@ -132,7 +132,8 @@
|
||||
"PushNotificationContents": "generic",
|
||||
"EnableEmailBatching": false,
|
||||
"EmailBatchingBufferSize": 256,
|
||||
"EmailBatchingInterval": 30
|
||||
"EmailBatchingInterval": 30,
|
||||
"SkipServerCertificateVerification": false
|
||||
},
|
||||
"RateLimitSettings": {
|
||||
"Enable": false,
|
||||
@@ -260,4 +261,4 @@
|
||||
"TurnUsername": "",
|
||||
"TurnSharedKey": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+27
-21
@@ -231,27 +231,28 @@ type FileSettings struct {
|
||||
}
|
||||
|
||||
type EmailSettings struct {
|
||||
EnableSignUpWithEmail bool
|
||||
EnableSignInWithEmail *bool
|
||||
EnableSignInWithUsername *bool
|
||||
SendEmailNotifications bool
|
||||
RequireEmailVerification bool
|
||||
FeedbackName string
|
||||
FeedbackEmail string
|
||||
FeedbackOrganization *string
|
||||
SMTPUsername string
|
||||
SMTPPassword string
|
||||
SMTPServer string
|
||||
SMTPPort string
|
||||
ConnectionSecurity string
|
||||
InviteSalt string
|
||||
PasswordResetSalt string
|
||||
SendPushNotifications *bool
|
||||
PushNotificationServer *string
|
||||
PushNotificationContents *string
|
||||
EnableEmailBatching *bool
|
||||
EmailBatchingBufferSize *int
|
||||
EmailBatchingInterval *int
|
||||
EnableSignUpWithEmail bool
|
||||
EnableSignInWithEmail *bool
|
||||
EnableSignInWithUsername *bool
|
||||
SendEmailNotifications bool
|
||||
RequireEmailVerification bool
|
||||
FeedbackName string
|
||||
FeedbackEmail string
|
||||
FeedbackOrganization *string
|
||||
SMTPUsername string
|
||||
SMTPPassword string
|
||||
SMTPServer string
|
||||
SMTPPort string
|
||||
ConnectionSecurity string
|
||||
InviteSalt string
|
||||
PasswordResetSalt string
|
||||
SendPushNotifications *bool
|
||||
PushNotificationServer *string
|
||||
PushNotificationContents *string
|
||||
EnableEmailBatching *bool
|
||||
EmailBatchingBufferSize *int
|
||||
EmailBatchingInterval *int
|
||||
SkipServerCertificateVerification *bool
|
||||
}
|
||||
|
||||
type RateLimitSettings struct {
|
||||
@@ -680,6 +681,11 @@ func (o *Config) SetDefaults() {
|
||||
*o.EmailSettings.EmailBatchingInterval = EMAIL_BATCHING_INTERVAL
|
||||
}
|
||||
|
||||
if o.EmailSettings.SkipServerCertificateVerification == nil {
|
||||
o.EmailSettings.SkipServerCertificateVerification = new(bool)
|
||||
*o.EmailSettings.SkipServerCertificateVerification = false
|
||||
}
|
||||
|
||||
if !IsSafeLink(o.SupportSettings.TermsOfServiceLink) {
|
||||
o.SupportSettings.TermsOfServiceLink = nil
|
||||
}
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ func connectToSMTPServer(config *model.Config) (net.Conn, *model.AppError) {
|
||||
|
||||
if config.EmailSettings.ConnectionSecurity == model.CONN_SECURITY_TLS {
|
||||
tlsconfig := &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
InsecureSkipVerify: *config.EmailSettings.SkipServerCertificateVerification,
|
||||
ServerName: config.EmailSettings.SMTPServer,
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ func newSMTPClient(conn net.Conn, config *model.Config) (*smtp.Client, *model.Ap
|
||||
}
|
||||
} else if config.EmailSettings.ConnectionSecurity == model.CONN_SECURITY_STARTTLS {
|
||||
tlsconfig := &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
InsecureSkipVerify: *config.EmailSettings.SkipServerCertificateVerification,
|
||||
ServerName: config.EmailSettings.SMTPServer,
|
||||
}
|
||||
c.StartTLS(tlsconfig)
|
||||
|
||||
Reference in New Issue
Block a user