[MM-17797] Add Timeout To SMTP Connection (#13251)

* model/config: add timeout setting to email settings

* services/mailservice: add timeout to connection

* app/server_app_adapter: show SMTP connection errors on log

* services/mailservice: add r/w deadline to smtp conn

* services/mailservice: add context timeout

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2020-03-10 18:34:31 +03:00
коммит произвёл GitHub
родитель 8327e9b0ba
Коммит 771574b652
4 изменённых файлов: 113 добавлений и 26 удалений

Просмотреть файл

@@ -123,7 +123,9 @@ func (s *Server) RunOldAppInitialization() error {
handlers: make(map[string]webSocketHandler),
}
mailservice.TestConnection(s.FakeApp().Config())
if err := mailservice.TestConnection(s.FakeApp().Config()); err != nil {
mlog.Error("Mail server connection test is failed: " + err.Message)
}
if _, err := url.ParseRequestURI(*s.FakeApp().Config().ServiceSettings.SiteURL); err != nil {
mlog.Error("SiteURL must be set. Some features will operate incorrectly if the SiteURL is not set. See documentation for details: http://about.mattermost.com/default-site-url")