From e6e563360bc294a4d05980b2950657febec409d9 Mon Sep 17 00:00:00 2001 From: Ibrahim Serdar Acikgoz Date: Thu, 16 Jul 2020 11:21:55 +0300 Subject: [PATCH] config: add smtp timeout to global_relay settings (#14994) --- app/diagnostics.go | 1 + model/config.go | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/diagnostics.go b/app/diagnostics.go index 7a5def4861..2b35ea4611 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -718,6 +718,7 @@ func (s *Server) trackConfig() { "is_default_global_relay_smtp_username": isDefault(*cfg.MessageExportSettings.GlobalRelaySettings.SmtpUsername, ""), "is_default_global_relay_smtp_password": isDefault(*cfg.MessageExportSettings.GlobalRelaySettings.SmtpPassword, ""), "is_default_global_relay_email_address": isDefault(*cfg.MessageExportSettings.GlobalRelaySettings.EmailAddress, ""), + "global_relay_smtp_server_timeout": *cfg.EmailSettings.SMTPServerTimeout, }) s.SendDiagnostic(TRACK_CONFIG_DISPLAY, map[string]interface{}{ diff --git a/model/config.go b/model/config.go index 6bc03d5594..ff1821bc84 100644 --- a/model/config.go +++ b/model/config.go @@ -2609,10 +2609,11 @@ func (s *PluginSettings) SetDefaults(ls LogSettings) { } type GlobalRelayMessageExportSettings struct { - CustomerType *string // must be either A9 or A10, dictates SMTP server url - SmtpUsername *string - SmtpPassword *string - EmailAddress *string // the address to send messages to + CustomerType *string // must be either A9 or A10, dictates SMTP server url + SmtpUsername *string + SmtpPassword *string + EmailAddress *string // the address to send messages to + SMTPServerTimeout *int } func (s *GlobalRelayMessageExportSettings) SetDefaults() { @@ -2628,6 +2629,9 @@ func (s *GlobalRelayMessageExportSettings) SetDefaults() { if s.EmailAddress == nil { s.EmailAddress = NewString("") } + if s.SMTPServerTimeout == nil || *s.SMTPServerTimeout == 0 { + s.SMTPServerTimeout = NewInt(1800) + } } type MessageExportSettings struct {