- 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.
25 lines
679 B
Go
25 lines
679 B
Go
package hosted
|
|
|
|
import "testing"
|
|
|
|
func TestMXMatchesExpected(t *testing.T) {
|
|
if !MXMatchesExpected([]string{"mail.acme.com."}, []string{"mail.acme.com"}) {
|
|
t.Fatal("exact mx match")
|
|
}
|
|
if !MXMatchesExpected([]string{"mx1.mail.ultisuite.fr"}, []string{"mail.ultisuite.fr"}) {
|
|
t.Fatal("suffix mx match")
|
|
}
|
|
if MXMatchesExpected([]string{"aspmx.l.google.com"}, []string{"mail.ultisuite.fr"}) {
|
|
t.Fatal("google mx should not match")
|
|
}
|
|
}
|
|
|
|
func TestTXTContainsToken(t *testing.T) {
|
|
if !TXTContainsToken([]string{"abc123", "other"}, "abc123") {
|
|
t.Fatal("expected token match")
|
|
}
|
|
if TXTContainsToken([]string{"wrong"}, "abc123") {
|
|
t.Fatal("unexpected token match")
|
|
}
|
|
}
|