From afc4b200201ac7bfc2a7d64c17e13c54056039a3 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 26 Jul 2026 21:39:26 +0200 Subject: [PATCH] Discover live internal SMTP listener in relay test --- contrib/testing/smtp-relayhost-check.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/testing/smtp-relayhost-check.py b/contrib/testing/smtp-relayhost-check.py index 8e64b0c..9815d80 100755 --- a/contrib/testing/smtp-relayhost-check.py +++ b/contrib/testing/smtp-relayhost-check.py @@ -191,6 +191,15 @@ def perform_test() -> None: if os.geteuid() != 0: raise SMTP09Error("the live relayhost test must run as root") original = SMTP07.read_smtp_configuration() + configured_host = str( + original.get("internal_relay_bind_address", "") + ).strip() + if configured_host in {"", "0.0.0.0", "::"}: + configured_host = "127.0.0.1" + SMTP07.INTERNAL_HOST = configured_host + SMTP07.INTERNAL_PORT = int( + original.get("internal_relay_port", SMTP07.INTERNAL_PORT) + ) originally_active = SMTP07.service_active() if not originally_active: raise SMTP09Error("bongo.service must be active before this live test")