From b6f776530ff915444065d23dba9aaf028a545777 Mon Sep 17 00:00:00 2001 From: tgiachi Date: Tue, 10 Nov 2026 12:37:13 +0100 Subject: [PATCH] test(ingest): match the refusal text of a non-publisher by suffix - the client sees the recipient in front of the server message --- internal/ingest/publisher_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ingest/publisher_test.go b/internal/ingest/publisher_test.go index aa9aff0..384e68f 100644 --- a/internal/ingest/publisher_test.go +++ b/internal/ingest/publisher_test.go @@ -2,6 +2,7 @@ package ingest import ( "errors" + "strings" "testing" "github.com/emersion/go-smtp" @@ -16,7 +17,7 @@ func TestANonPublisherIsRefusedPermanentlyByANewsletter(t *testing.T) { res := deliver(t, st.addr, "alice@example.com", []string{"dev@example.org"}) var se *smtp.SMTPError if !errors.As(res["dev@example.org"], &se) || se.Code != 550 || - se.EnhancedCode != (smtp.EnhancedCode{5, 7, 1}) || se.Message != "only the publishers of this list may post" { + se.EnhancedCode != (smtp.EnhancedCode{5, 7, 1}) || !strings.HasSuffix(se.Message, "only the publishers of this list may post") { t.Fatalf("want 550 5.7.1, got %v", res["dev@example.org"]) } if st.queued(t) != 0 {