From a0bbd13afc17e5bd7eb845d2045b8bc156c19d25 Mon Sep 17 00:00:00 2001 From: Laurent Meunier Date: Sun, 31 Mar 2024 12:32:12 +0200 Subject: [PATCH] Improve SMTPUTF8 tests --- smtpserver/server_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smtpserver/server_test.go b/smtpserver/server_test.go index 5473708..9b201e6 100644 --- a/smtpserver/server_test.go +++ b/smtpserver/server_test.go @@ -1799,7 +1799,7 @@ QW4gYXR0YWNoZWQgdGV4dCBmaWxlLg== --simple boundary-- `, mailFrom, rcptTo, headerValue, filename), "\n", "\r\n") - err := client.Deliver(ctxbg, mailFrom, rcptTo, int64(len(msg)), strings.NewReader(msg), false, clientSmtputf8, false) + err := client.Deliver(ctxbg, mailFrom, rcptTo, int64(len(msg)), strings.NewReader(msg), true, clientSmtputf8, false) var cerr smtpclient.Error if expErr == nil && err != nil || expErr != nil && (err == nil || !errors.As(err, &cerr) || cerr.Code != expErr.Code || cerr.Secode != expErr.Secode) { t.Fatalf("got err %#v, expected %#v", err, expErr) @@ -1823,7 +1823,8 @@ QW4gYXR0YWNoZWQgdGV4dCBmaWxlLg== test(`Ω@mox.example`, `remote@example.org`, "header-ascii", "ascii.txt", true, true, nil) test(`Ω@mox.example`, `remote@example.org`, "header-ascii", "ascii.txt", false, true, &smtpclient.Error{Permanent: true, Code: smtp.C550MailboxUnavail, Secode: smtp.SeMsg6NonASCIIAddrNotPermitted7}) test(`mjl@mox.example`, `remote@example.org`, "header-utf8-😍", "ascii.txt", true, true, nil) + test(`mjl@mox.example`, `remote@example.org`, "header-utf8-😍", "ascii.txt", false, true, nil) test(`mjl@mox.example`, `remote@example.org`, "header-ascii", "utf8-🫠️.txt", true, true, nil) test(`Ω@mox.example`, `🙂@example.org`, "header-utf8-😍", "utf8-🫠️.txt", true, true, nil) - test(`mjl@mox.example`, `remote@idn-🌏️.org`, "header-ascii", "ascii.txt", true, true, nil) + test(`mjl@mox.example`, `remote@xn--vg8h.example.org`, "header-ascii", "ascii.txt", true, false, nil) }