diff --git a/CHANGELOG.md b/CHANGELOG.md index 3782536e..0583e2ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,9 @@ This version includes **multiple breaking changes**. If you are upgrading from v - Sorting order issues when emails lack `receivedAt` headers. - IMAP: Fix `BINARY` fetch responses (#2940). - ACME: Allow requesting apex domain certificates. -- Bootstrap: Accept RFC 6761 reserved TLDs during bootstrap. +- Hostname issues: + - Accept RFC 6761 reserved TLDs during bootstrap. + - Allow hostnames without TLDs in remote server settings. - Reverse proxy issues. - OSS builds. - DNS Updater: diff --git a/crates/jmap/src/registry/mapping/bootstrap.rs b/crates/jmap/src/registry/mapping/bootstrap.rs index 44636157..468b5e97 100644 --- a/crates/jmap/src/registry/mapping/bootstrap.rs +++ b/crates/jmap/src/registry/mapping/bootstrap.rs @@ -506,7 +506,7 @@ pub(crate) async fn bootstrap_set( } fn is_valid_domain(hostname: &str) -> bool { - const RESERVED_TLDS: &[&str] = &["test", "localhost", "local"]; + const RESERVED_TLDS: &[&str] = &["test", "localhost", "local", "internal"]; psl::domain_str(hostname).is_some() || RESERVED_TLDS.contains(&hostname) || hostname diff --git a/crates/registry/src/schema/structs_impl.rs b/crates/registry/src/schema/structs_impl.rs index fe0d334a..08f0162c 100644 --- a/crates/registry/src/schema/structs_impl.rs +++ b/crates/registry/src/schema/structs_impl.rs @@ -19291,7 +19291,7 @@ impl RegistryJsonPropertyPatch for MtaMilter { Some(Property::Enable) => self.enable.patch(pointer, value), Some(Property::Hostname) => self .hostname - .patch(pointer.with_validators(&[StringValidator::Hostname]), value), + .patch(pointer.with_validators(&[StringValidator::Trim]), value), Some(Property::MaxResponseSize) => self.max_response_size.patch(pointer, value), Some(Property::TempFailOnError) => self.temp_fail_on_error.patch(pointer, value), Some(Property::ProtocolVersion) => self.protocol_version.patch(pointer, value), @@ -20128,7 +20128,7 @@ impl RegistryJsonPropertyPatch for MtaRouteRelay { match pointer.next_property() { Some(Property::Address) => self .address - .patch(pointer.with_validators(&[StringValidator::Hostname]), value), + .patch(pointer.with_validators(&[StringValidator::Trim]), value), Some(Property::AuthSecret) => self.auth_secret.patch(pointer, value), Some(Property::AuthUsername) => self.auth_username.patch(pointer, value), Some(Property::Port) => self.port.patch(pointer, value), @@ -21711,7 +21711,7 @@ impl RegistryJsonPropertyPatch for MySqlSettings { match pointer.next_property() { Some(Property::Host) => self .host - .patch(pointer.with_validators(&[StringValidator::Hostname]), value), + .patch(pointer.with_validators(&[StringValidator::Trim]), value), Some(Property::Port) => self.port.patch(pointer, value), Some(Property::Database) => self .database @@ -21895,7 +21895,7 @@ impl RegistryJsonPropertyPatch for MySqlStore { Some(Property::ReadReplicas) => self.read_replicas.patch(pointer, value), Some(Property::Host) => self .host - .patch(pointer.with_validators(&[StringValidator::Hostname]), value), + .patch(pointer.with_validators(&[StringValidator::Trim]), value), Some(Property::Port) => self.port.patch(pointer, value), Some(Property::Database) => self .database @@ -23213,7 +23213,7 @@ impl RegistryJsonPropertyPatch for PostgreSqlSettings { match pointer.next_property() { Some(Property::Host) => self .host - .patch(pointer.with_validators(&[StringValidator::Hostname]), value), + .patch(pointer.with_validators(&[StringValidator::Trim]), value), Some(Property::Port) => self.port.patch(pointer, value), Some(Property::Database) => self .database @@ -23379,7 +23379,7 @@ impl RegistryJsonPropertyPatch for PostgreSqlStore { Some(Property::ReadReplicas) => self.read_replicas.patch(pointer, value), Some(Property::Host) => self .host - .patch(pointer.with_validators(&[StringValidator::Hostname]), value), + .patch(pointer.with_validators(&[StringValidator::Trim]), value), Some(Property::Port) => self.port.patch(pointer, value), Some(Property::Database) => self .database