Adding image properties
Этот коммит содержится в:
@@ -198,13 +198,13 @@ func getClientProperties(c *model.Config) map[string]string {
|
||||
return props
|
||||
}
|
||||
|
||||
func IsS3Configured() bool {
|
||||
if Cfg.AWSSettings.S3AccessKeyId == "" || Cfg.AWSSettings.S3SecretAccessKey == "" || Cfg.AWSSettings.S3Region == "" || Cfg.AWSSettings.S3Bucket == "" {
|
||||
return false
|
||||
}
|
||||
// func IsS3Configured() bool {
|
||||
// if Cfg.AWSSettings.AmazonS3AccessKeyId == "" || Cfg.AWSSettingsAmazonS3SecretAccessKey == "" || Cfg.AWSSettingsAmazonS3Region == "" || Cfg.AWSSettingsAmazonS3Bucket == "" {
|
||||
// return false
|
||||
// }
|
||||
|
||||
return true
|
||||
}
|
||||
// return true
|
||||
// }
|
||||
|
||||
func IsServiceAllowed(s string) bool {
|
||||
if len(s) == 0 {
|
||||
|
||||
@@ -15,17 +15,11 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
CONN_SECURITY_NONE = ""
|
||||
CONN_SECURITY_TLS = "TLS"
|
||||
CONN_SECURITY_STARTTLS = "STARTTLS"
|
||||
)
|
||||
|
||||
func connectToSMTPServer(config *model.Config) (net.Conn, *model.AppError) {
|
||||
var conn net.Conn
|
||||
var err error
|
||||
|
||||
if config.EmailSettings.ConnectionSecurity == CONN_SECURITY_TLS {
|
||||
if config.EmailSettings.ConnectionSecurity == model.CONN_SECURITY_TLS {
|
||||
tlsconfig := &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
ServerName: config.EmailSettings.SMTPServer,
|
||||
@@ -54,11 +48,11 @@ func newSMTPClient(conn net.Conn, config *model.Config) (*smtp.Client, *model.Ap
|
||||
// GO does not support plain auth over a non encrypted connection.
|
||||
// so if not tls then no auth
|
||||
auth := smtp.PlainAuth("", config.EmailSettings.SMTPUsername, config.EmailSettings.SMTPPassword, config.EmailSettings.SMTPServer+":"+config.EmailSettings.SMTPPort)
|
||||
if config.EmailSettings.ConnectionSecurity == CONN_SECURITY_TLS {
|
||||
if config.EmailSettings.ConnectionSecurity == model.CONN_SECURITY_TLS {
|
||||
if err = c.Auth(auth); err != nil {
|
||||
return nil, model.NewAppError("SendMail", "Failed to authenticate on SMTP server", err.Error())
|
||||
}
|
||||
} else if config.EmailSettings.ConnectionSecurity == CONN_SECURITY_TLS {
|
||||
} else if config.EmailSettings.ConnectionSecurity == model.CONN_SECURITY_STARTTLS {
|
||||
tlsconfig := &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
ServerName: config.EmailSettings.SMTPServer,
|
||||
|
||||
Ссылка в новой задаче
Block a user