mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-23 15:37:01 +00:00
smtpsrv: Disable SPF lookups in tests
When testing, we don't want the server to do SPF lookups, as those cause real DNS queries which can be problematic and add a dependency on the environment. This patch adds an internal boolean to disable the SPF lookups, which is only set from the tests.
This commit is contained in:
@@ -453,6 +453,9 @@ func realMain(m *testing.M) int {
|
||||
s.AddDomain("localhost")
|
||||
s.AddUserDB("localhost", udb)
|
||||
|
||||
// Disable SPF lookups, to avoid leaking DNS queries.
|
||||
disableSPFForTesting = true
|
||||
|
||||
go s.ListenAndServe()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user