From 3957477b16765de8906af6bcff635c1580ec203e Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 26 Jul 2026 19:22:12 +0200 Subject: [PATCH] Report SMTP-27 delivery matrix on timeout --- contrib/testing/smtp-dane-mta-sts-check.py | 40 ++++++++++++++++------ 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/contrib/testing/smtp-dane-mta-sts-check.py b/contrib/testing/smtp-dane-mta-sts-check.py index edd85bb..ba4f7a3 100755 --- a/contrib/testing/smtp-dane-mta-sts-check.py +++ b/contrib/testing/smtp-dane-mta-sts-check.py @@ -568,16 +568,36 @@ def validate_initial( "initial") for name in failure } - wait_until( - lambda: ( - all(matching_messages( - captures[name], - next(route for route in ROUTES if route.name == name), - "initial") for name in success) - and queued_tokens(queued) == queued - ), - "DANE and MTA-STS initial outcomes", - ) + try: + wait_until( + lambda: ( + all(matching_messages( + captures[name], + next(route for route in ROUTES if route.name == name), + "initial") for name in success) + and queued_tokens(queued) == queued + ), + "DANE and MTA-STS initial outcomes", + ) + except SMTP27Error as error: + details = [] + for route in ROUTES: + connections, starttls, messages = captures[route.name].snapshot() + matching = len(matching_messages( + captures[route.name], route, "initial")) + details.append( + f"{route.name}: connections={connections}, " + f"starttls={starttls}, messages={len(messages)}, " + f"matching={matching}") + found = queued_tokens(queued) + details.append( + "queued expected=" + + ",".join(sorted(queued)) + + " found=" + + ",".join(sorted(found))) + raise SMTP27Error( + str(error) + "\n--- delivery matrix ---\n" + + "\n".join(details)) from error for name in success: route = next(route for route in ROUTES if route.name == name) messages = matching_messages(captures[name], route, "initial")