MFA fix, added IP blacklist, update webmail client

This commit is contained in:
2026-08-14 13:04:55 +01:00
parent 6063f95504
commit 892f366a16
122 changed files with 13362 additions and 251 deletions
+14 -4
View File
@@ -56,15 +56,25 @@ func TestWebmailLoginSucceedsAndReachesDashboard(t *testing.T) {
t.Fatal("expected a mailbox session cookie to be set")
}
// The webmail root is the mailbox itself now, not account settings — it redirects
// straight to the inbox.
req2 := httptest.NewRequest(http.MethodGet, MailboxPrefix+"/", nil)
req2.AddCookie(sessionCookie)
rec2 := httptest.NewRecorder()
mux.ServeHTTP(rec2, req2)
if rec2.Code != http.StatusOK {
t.Fatalf("expected dashboard to render, got %d: %s", rec2.Code, rec2.Body.String())
if rec2.Code != http.StatusFound || rec2.Header().Get("Location") != MailboxPrefix+"/mail/INBOX" {
t.Fatalf("expected the webmail root to redirect to the inbox, got %d Location=%q", rec2.Code, rec2.Header().Get("Location"))
}
if !strings.Contains(rec2.Body.String(), "portaluser@example.com") {
t.Fatal("expected the dashboard to show the mailbox's own email")
req3 := httptest.NewRequest(http.MethodGet, MailboxPrefix+"/account", nil)
req3.AddCookie(sessionCookie)
rec3 := httptest.NewRecorder()
mux.ServeHTTP(rec3, req3)
if rec3.Code != http.StatusOK {
t.Fatalf("expected the account page to render, got %d: %s", rec3.Code, rec3.Body.String())
}
if !strings.Contains(rec3.Body.String(), "portaluser@example.com") {
t.Fatal("expected the account page to show the mailbox's own email")
}
}