From c1decadb590c4d79d92bcc4df7772119a5c91244 Mon Sep 17 00:00:00 2001 From: Gab Virebent Date: Sat, 22 Aug 2026 20:36:56 +0200 Subject: Initial Aegis Usenet client release --- internal/smtpclient/client_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 internal/smtpclient/client_test.go (limited to 'internal/smtpclient/client_test.go') diff --git a/internal/smtpclient/client_test.go b/internal/smtpclient/client_test.go new file mode 100644 index 0000000..6572f9a --- /dev/null +++ b/internal/smtpclient/client_test.go @@ -0,0 +1,17 @@ +package smtpclient + +import "testing" + +func TestValidateOnionRequiresProxy(t *testing.T) { + err := validate(Config{Host: "mail.example.onion", Port: "465", Mode: "TLS", ProxyType: "DIRECT"}, "a@example.org", []string{"news@example.org"}) + if err == nil { + t.Fatal("expected onion proxy validation error") + } +} + +func TestValidateAllowsCleartextOnion(t *testing.T) { + err := validate(Config{Host: "mail.example.onion", Port: "25", Mode: "", ProxyType: "SOCKS5", ProxyAddress: "127.0.0.1:9050"}, "a@example.org", []string{"news@example.org"}) + if err != nil { + t.Fatalf("cleartext onion SMTP should be allowed: %v", err) + } +} -- cgit v1.2.3