mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
feat: hardcode mail.sangham.net into DNS cache
This commit is contained in:
17
src/net.rs
17
src/net.rs
@@ -1,4 +1,5 @@
|
|||||||
//! # Common network utilities.
|
//! # Common network utilities.
|
||||||
|
use std::net::Ipv4Addr;
|
||||||
use std::net::{IpAddr, SocketAddr};
|
use std::net::{IpAddr, SocketAddr};
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
@@ -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)
|
Ok(resolved_addrs)
|
||||||
|
|||||||
Reference in New Issue
Block a user