Skip to content

Commit

Permalink
Merge d7f266e into 120f5a6
Browse files Browse the repository at this point in the history
  • Loading branch information
grundleborg committed Mar 23, 2017
2 parents 120f5a6 + d7f266e commit aa930a4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
5 changes: 3 additions & 2 deletions config/config.json
Expand Up @@ -132,7 +132,8 @@
"PushNotificationContents": "generic",
"EnableEmailBatching": false,
"EmailBatchingBufferSize": 256,
"EmailBatchingInterval": 30
"EmailBatchingInterval": 30,
"SkipServerCertificateVerification": false
},
"RateLimitSettings": {
"Enable": false,
Expand Down Expand Up @@ -260,4 +261,4 @@
"TurnUsername": "",
"TurnSharedKey": ""
}
}
}
48 changes: 27 additions & 21 deletions model/config.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions utils/mail.go
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit aa930a4

Please sign in to comment.