修复生产审查凭据泄露风险并增加持久投递队列
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-17 10:17:09 +08:00
1 parent 24670a3c2d
commit bf1e69f480
70 files changed
+1581 -262

No files matched your search

+15
View File
@@ -219,6 +219,10 @@ func startSMTPTransactionServer(t *testing.T, dataResponse string, holdWithoutQu
done <- fmt.Errorf("message body was not received: %q", body)
return
}
if dataResponse == "" {
done <- nil
return
}
if err := text.PrintfLine("%s", dataResponse); err != nil {
done <- err
return
@@ -244,6 +248,17 @@ func startSMTPTransactionServer(t *testing.T, dataResponse string, holdWithoutQu
return listener.Addr().String(), done
}
func TestLostFinalDATAResponseIsUncertain(t *testing.T) {
addr, done := startSMTPTransactionServer(t, "", false)
err := SendMailUnsafe("localhost", addr, nil, "sender@example.com", "example.com", []string{"recipient@example.net"}, []byte("Subject: test\r\n\r\nbody\r\n"))
if !IsDeliveryUncertain(err) {
t.Fatalf("error=%v, want uncertain delivery", err)
}
if err := <-done; err != nil {
t.Fatal(err)
}
}
func expectSMTPCommand(conn *textproto.Conn, prefix string) error {
line, err := conn.ReadLine()
if err != nil {