Skip to content

Commit

Permalink
feat: hardcode mail.sangham.net into DNS cache
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Nov 4, 2023
1 parent 9cd3a75 commit 16b40f3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/net.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! # Common network utilities.
use std::net::Ipv4Addr;
use std::net::{IpAddr, SocketAddr};
use std::pin::Pin;
use std::str::FromStr;
Expand Down Expand Up @@ -119,6 +120,22 @@ async fn lookup_host_with_cache(
}
}
}

if resolved_addrs.is_empty() {
// Load hardcoded cache if everything else fails.
//
// See <https://support.delta.chat/t/no-dns-resolution-result/2778> and
// <https://github.com/deltachat/deltachat-core-rust/issues/4920> for reasons.
//
// In the future we may pre-resolve all provider database addresses
// and build them in.
if hostname == "mail.sangham.net" {
resolved_addrs.push(SocketAddr::new(
IpAddr::V4(Ipv4Addr::new(159, 69, 186, 85)),
port,
));
}
}
}

Ok(resolved_addrs)
Expand Down

0 comments on commit 16b40f3

Please sign in to comment.