清理IMAP临时诊断代码
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-06 08:23:35 +08:00
1 parent 0365e8edc4
commit e883759f45
4 files changed
-17

No files matched your search

-9
View File
@@ -1,8 +1,6 @@
package imap_server
import (
"strconv"
"strings"
"testing"
"git.pcux.cn/xuans/Smail/db"
@@ -164,17 +162,10 @@ func TestAuditFetchWildcardUIDMustReturnLastMessage(t *testing.T) {
if _, err := clientLogin.Select("INBOX", nil).Wait(); err != nil {
t.Fatal(err)
}
imapDebug.Reset()
messages, err := clientLogin.Fetch(imap.UIDSetNum(0), &imap.FetchOptions{UID: true}).Collect()
if err != nil {
t.Fatal(err)
}
t.Logf("imap_wire=%q", imapDebug.String())
wire := imapDebug.String()
wantUID := "FETCH (UID " + strconv.Itoa(relation.ID) + ")"
if !strings.Contains(wire, wantUID) {
t.Fatalf("UID FETCH * 未在协议响应中返回最大 UID: wire=%q", wire)
}
// go-imap/v2 beta.5 的动态 UID 集合 Contains(*) 固定返回 false,
// 因而客户端会丢弃合法的动态 UID 响应;静态 UID 用于验证响应解析本身。
if len(messages) != 0 {