Discover live internal SMTP listener in relay test
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user