Skip to content

Commit 16b40f3

Browse files
committed
feat: hardcode mail.sangham.net into DNS cache
1 parent 9cd3a75 commit 16b40f3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/net.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! # Common network utilities.
2+
use std::net::Ipv4Addr;
23
use std::net::{IpAddr, SocketAddr};
34
use std::pin::Pin;
45
use std::str::FromStr;
@@ -119,6 +120,22 @@ async fn lookup_host_with_cache(
119120
}
120121
}
121122
}
123+
124+
if resolved_addrs.is_empty() {
125+
// Load hardcoded cache if everything else fails.
126+
//
127+
// See <https://support.delta.chat/t/no-dns-resolution-result/2778> and
128+
// <https://github.com/deltachat/deltachat-core-rust/issues/4920> for reasons.
129+
//
130+
// In the future we may pre-resolve all provider database addresses
131+
// and build them in.
132+
if hostname == "mail.sangham.net" {
133+
resolved_addrs.push(SocketAddr::new(
134+
IpAddr::V4(Ipv4Addr::new(159, 69, 186, 85)),
135+
port,
136+
));
137+
}
138+
}
122139
}
123140

124141
Ok(resolved_addrs)

0 commit comments

Comments
 (0)