- Added configuration options for Stalwart hosted mail in .env.example. - Updated Docker Compose to include Stalwart service with health checks. - Introduced new API endpoints for managing mail domains and migration projects. - Enhanced Authentik blueprints for user enrollment and post-migration security. - Updated OAuth handling for Google and Microsoft migration processes. - Improved error handling and response structures in the mail API. - Added integration tests for email claiming and migration workflows.
29 lines
613 B
Go
29 lines
613 B
Go
package stalwart
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestClientDisabledCreateDomain(t *testing.T) {
|
|
c := NewClient(Config{Enabled: false})
|
|
d, err := c.CreateDomain(context.Background(), "example.com")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if d.Name != "example.com" {
|
|
t.Fatalf("expected example.com, got %q", d.Name)
|
|
}
|
|
}
|
|
|
|
func TestClientDisabledCreateAccount(t *testing.T) {
|
|
c := NewClient(Config{Enabled: false})
|
|
a, err := c.CreateAccount(context.Background(), "local-example.com", "alice", "secret", 1024)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if a.ID == "" {
|
|
t.Fatal("expected local account id")
|
|
}
|
|
}
|