diff options
| author | Gab Virebent <gabriel1@virebent.art> | 2026-08-22 20:36:56 +0200 |
|---|---|---|
| committer | Gab Virebent <gabriel1@virebent.art> | 2026-08-22 20:36:56 +0200 |
| commit | c1decadb590c4d79d92bcc4df7772119a5c91244 (patch) | |
| tree | 468f9fa37535dbb90cc5d4061eb20de83912131e /internal/smtpclient/client_test.go | |
| download | aegis-c1decadb590c4d79d92bcc4df7772119a5c91244.tar.gz aegis-c1decadb590c4d79d92bcc4df7772119a5c91244.tar.xz aegis-c1decadb590c4d79d92bcc4df7772119a5c91244.zip | |
Initial Aegis Usenet client release
Diffstat (limited to 'internal/smtpclient/client_test.go')
| -rw-r--r-- | internal/smtpclient/client_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
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) + } +} |
