- 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.
38 lines
994 B
Go
38 lines
994 B
Go
package migration
|
|
|
|
import "testing"
|
|
|
|
func TestParseCutoverMXHostsExplicit(t *testing.T) {
|
|
got := ParseCutoverMXHosts(" Mail.Acme.Com , mx2.acme.com ", "", "")
|
|
want := []string{"mail.acme.com", "mx2.acme.com"}
|
|
if len(got) != len(want) {
|
|
t.Fatalf("got %v want %v", got, want)
|
|
}
|
|
for i := range want {
|
|
if got[i] != want[i] {
|
|
t.Fatalf("got %v want %v", got, want)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestParseCutoverMXHostsFallbackPlatform(t *testing.T) {
|
|
got := ParseCutoverMXHosts("", "Ultisuite.Fr", "")
|
|
if len(got) != 1 || got[0] != "mail.ultisuite.fr" {
|
|
t.Fatalf("got %v", got)
|
|
}
|
|
}
|
|
|
|
func TestParseCutoverMXHostsFallbackStalwart(t *testing.T) {
|
|
got := ParseCutoverMXHosts("", "", "mail.hosted.example.com")
|
|
if len(got) != 1 || got[0] != "mail.hosted.example.com" {
|
|
t.Fatalf("got %v", got)
|
|
}
|
|
}
|
|
|
|
func TestParseCutoverMXHostsSkipsBareStalwartHost(t *testing.T) {
|
|
got := ParseCutoverMXHosts("", "acme.fr", "stalwart")
|
|
if len(got) != 1 || got[0] != "mail.acme.fr" {
|
|
t.Fatalf("got %v", got)
|
|
}
|
|
}
|