author | Alberto Bertogli
<albertito@blitiri.com.ar> 2019-12-01 18:48:08 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2019-12-01 19:09:58 UTC |
parent | e8a6bf61881b3aa0709abc3fab6ea112154add39 |
internal/smtpsrv/server.go | +3 | -0 |
internal/smtpsrv/server_test.go | +3 | -0 |
diff --git a/internal/smtpsrv/server.go b/internal/smtpsrv/server.go index 4e3105a..9b5fe28 100644 --- a/internal/smtpsrv/server.go +++ b/internal/smtpsrv/server.go @@ -163,6 +163,9 @@ func (s *Server) InitQueue(path string, localC, remoteC courier.Courier) { // periodicallyReload some of the server's information, such as aliases and // the user databases. func (s *Server) periodicallyReload() { + if reloadEvery == nil { + return + } for range time.Tick(*reloadEvery) { err := s.aliasesR.Reload() if err != nil { diff --git a/internal/smtpsrv/server_test.go b/internal/smtpsrv/server_test.go index 6da06a8..3e46726 100644 --- a/internal/smtpsrv/server_test.go +++ b/internal/smtpsrv/server_test.go @@ -584,6 +584,9 @@ func realMain(m *testing.M) int { // Disable SPF lookups, to avoid leaking DNS queries. disableSPFForTesting = true + // Disable reloading. + reloadEvery = nil + go s.ListenAndServe() }