Allow hostnames without TLDs in remote server settings

This commit is contained in:
Maurus Decimus
2026-04-24 08:03:43 +02:00
parent 0b8834d04a
commit 7d7832fd0f
3 changed files with 10 additions and 8 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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