test(ingest): match the refusal text of a non-publisher by suffix
- the client sees the recipient in front of the server message
This commit is contained in:
parent
d4f706523f
commit
b6f776530f
1 changed files with 2 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue