From 68d1fa8f01b0df83bb1b7b55eed29a35cb3fd507 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sun, 8 Mar 2026 22:44:51 +0100 Subject: [PATCH] only use explicit server settings if the host resolves to ip address via ssh config --- cmdeploy/src/cmdeploy/tests/plugin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmdeploy/src/cmdeploy/tests/plugin.py b/cmdeploy/src/cmdeploy/tests/plugin.py index aa3f0b37..e7d1cefd 100644 --- a/cmdeploy/src/cmdeploy/tests/plugin.py +++ b/cmdeploy/src/cmdeploy/tests/plugin.py @@ -409,13 +409,16 @@ class ChatmailACFactory: def _make_transport(self, domain): """Build a transport config dict for the given domain.""" addr, password = self.gencreds(domain) - server = self._ssh_config_host_map.get(domain, domain) transport = { "addr": addr, "password": password, - "imapServer": server, - "smtpServer": server, } + # To support running against local relays without host DNS resolution + # we attempt resolving the domain via ssh-config + # because otherwise core fails to find the address + server = self._ssh_config_host_map.get(domain) + if server is not None: + transport.update({"imapServer": server, "smtpServer": server}) if self.chatmail_config.tls_cert_mode == "self": transport["certificateChecks"] = "acceptInvalidCertificates" return transport