fix: raise an error if MX lookup times out during sending

This avoids potentially sending mail to the A record when an MX query times out.

closes #2833
This commit is contained in:
Adam Cooke
2024-03-01 21:36:07 +00:00
parent 77e818a472
commit fadca88f45
7 changed files with 231 additions and 33 deletions
+1 -1
View File
@@ -301,7 +301,7 @@ describe Domain do
context "when local nameservers should not be used" do
it "uses the a resolver for this domain" do
allow(DNSResolver).to receive(:for_domain).with(domain.name).and_return(DNSResolver.new(nameservers: ["1.2.3.4"]))
allow(DNSResolver).to receive(:for_domain).with(domain.name).and_return(DNSResolver.new(["1.2.3.4"]))
expect(domain.resolver).to be_a DNSResolver
expect(domain.resolver.nameservers).to eq ["1.2.3.4"]
end