From 853e0cabf38eed43387ce57ec128b6739264b4d6 Mon Sep 17 00:00:00 2001 From: Mix Date: Sun, 18 Oct 2026 23:35:50 +0300 Subject: [PATCH] e2e: the queues as tables - a deferred message on each, the empty one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - queue_readable_by_the_panel: the empty queue says "Nothing is waiting" (it read postqueue -p's "Mail queue is empty"). - expired_message_is_closed: while defer_transports holds the message, Outbound › Queue lists it with Postfix's reason ("deferred transport", qmgr_message.c) and a Details link to its row. - inbound_relay_delivers_and_refuses (testInboundUpstreamDown): the message for an upstream that refuses is on Inbound › Queue with "connect to 10.77.0.11[10.77.0.11]:2526: Connection refused", and not on Outbound › Queue. make e2e on the test server for 6db3704 plus this: 65 passed, 0 failed; go vet + go test there: 26 packages. Co-Authored-By: Claude Opus 5.5 --- test/e2e/delivery_log_test.go | 11 +++++++++++ test/e2e/inbound_upstream_test.go | 16 ++++++++++++++++ test/e2e/main_test.go | 6 +++--- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/test/e2e/delivery_log_test.go b/test/e2e/delivery_log_test.go index 72d1e4f..6d46594 100644 --- a/test/e2e/delivery_log_test.go +++ b/test/e2e/delivery_log_test.go @@ -136,6 +136,17 @@ print("" if r is None else r[0]+" "+r[1])`, token) t.Fatal(err) } + // Outbound › Queue lists the waiting recipient, with Postfix's reason and + // the link to its row in the Outbound log (postqueue -j, as the panel). + _, body, err := sc.panel.get("/outbound/queue") + if err != nil { + t.Fatal(err) + } + if !strings.Contains(body, ``+queueID+``) || !regexp.MustCompile(`[^<]*deferred transport`).MatchString(body) || + !regexp.MustCompile(`Details`).MatchString(body) { + t.Fatalf("Outbound › Queue does not list the deferred message %s with its reason and row:\n%.4000s", queueID, body) + } + exec("postsuper", "-e", queueID) exec("postqueue", "-i", queueID) if err := waitFor("the expired message's row to be bounced", 30*time.Second, 500*time.Millisecond, func() (bool, error) { diff --git a/test/e2e/inbound_upstream_test.go b/test/e2e/inbound_upstream_test.go index 84d4799..971663f 100644 --- a/test/e2e/inbound_upstream_test.go +++ b/test/e2e/inbound_upstream_test.go @@ -93,6 +93,22 @@ print("" if r is None else "|".join(r))`, token) t.Fatalf("the Inbound log does not show the deferral:\n%.4000s", body) } + // The message waits on Inbound › Queue with the upstream's reason, and not + // on Outbound › Queue: one Postfix queue, split by the recipient's domain. + _, body, err = sc.panel.get("/inbound/queue") + if err != nil { + t.Fatal(err) + } + if !strings.Contains(body, ``+queueID+``) || + !strings.Contains(body, `connect to 10.77.0.11[10.77.0.11]:2526: Connection refused`) { + t.Fatalf("Inbound › Queue does not list the deferred message %s:\n%.4000s", queueID, body) + } + if _, body, err = sc.panel.get("/outbound/queue"); err != nil { + t.Fatal(err) + } else if strings.Contains(body, queueID) { + t.Fatalf("Outbound › Queue lists the inbound message %s", queueID) + } + for _, args := range [][]string{{"postsuper", "-e", queueID}, {"postqueue", "-i", queueID}} { if out, err := h.execIn("selfpost", args...); err != nil { t.Fatalf("%s: %v\n%s", strings.Join(args, " "), err, out) diff --git a/test/e2e/main_test.go b/test/e2e/main_test.go index d7b8cc6..751c865 100644 --- a/test/e2e/main_test.go +++ b/test/e2e/main_test.go @@ -214,10 +214,10 @@ func TestE2E(t *testing.T) { t.Fatalf("GET /outbound/queue = %d", resp.StatusCode) } if strings.Contains(body, "Could not read the mail queue") { - t.Fatal("the panel could not run postqueue -p (queue directory permissions)") + t.Fatal("the panel could not run postqueue -j (queue directory permissions)") } - if !strings.Contains(body, "Mail queue is empty") { - t.Fatalf("the queue page does not show postqueue's listing of an empty queue:\n%s", body) + if !strings.Contains(body, "Nothing is waiting. Every message has reached its receiving server.") { + t.Fatalf("the queue page does not say the queue is empty:\n%s", body) } })