Steven RYDELLandClaude Sonnet 5 bd00b4e922 fix: persist active account across reload, remount views on switch
Aligns with upstream stalwartlabs/webui@189e270 (v1.0.7, "fixes #17"),
reviewed after they independently landed a fix for the same issue:

- authStore now persists activeAccountId (sessionStorage) and
  setSession preserves it across a session refresh instead of always
  resetting to primaryAccountId, so a hard reload keeps you on the
  group account you had selected instead of bouncing back to your own.
- switchAccount now clears cacheStore (displayNames/objectLists) when
  actually changing account, since those were resolved against the
  previous account and would otherwise show stale labels.
- The ErrorBoundary wrapping MainContent is now keyed on
  activeAccountId, forcing a full remount of every view on switch.
  This is more robust than gating individual components' fetch
  effects on activeAccountId (our earlier fix in DynamicList.tsx,
  kept as-is — harmless now, but no longer load-bearing on its own)
  since it covers every current and future view type, not just lists.

Verified against a live instance: switching to a group account updates
the JMAP accountId immediately (no tab switch needed), and a full page
reload keeps the group account active instead of resetting to admin.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-30 17:48:19 +02:00
2026-04-20 15:14:54 +02:00
2026-04-20 18:42:46 +02:00
2026-04-20 15:02:57 +02:00
2026-04-20 15:02:57 +02:00
2026-04-20 15:02:57 +02:00
2026-04-20 15:02:57 +02:00
2026-07-29 08:05:20 +02:00
2026-04-20 15:02:57 +02:00
2026-04-20 15:02:57 +02:00
2026-07-28 10:57:30 +02:00

Web-based User Interface for Stalwart 🛡️

Community fork of stalwartlabs/webui with UI improvements and fixes.


continuous integration   License: AGPL v3   Documentation

Mastodon   Twitter

Discord   Matrix

Features

Stalwart WebUI is schema-driven single-page application for administering Stalwart. After authentication the panel fetches a JSON schema from the server and dynamically generates all forms, lists, navigation, and layouts from that schema. Nothing is hardcoded.

Key features:

  • Schema-driven UI: All forms, lists, and navigation are generated from a JSON schema fetched from /api/schema after login. No object types, field names, or layouts are hardcoded.
  • JMAP protocol: All data operations (queries, creates, updates, deletes, blob uploads) use JMAP (RFC 8620) with method chaining and result references.
  • Permission-aware: Every button, link, field, and section respects the user's permissions. Elements the user cannot access are hidden.

Screenshots

Get Started

Stalwart WebUI is included with Stalwart Mail Server, to install Stalwart Mail Server on your server by following the instructions for your platform:

All documentation is available at stalw.art/docs/get-started.

Getting started

Prerequisites:

  • Node.js 18 or later
  • A running Stalwart instance (for JMAP API calls)

Install dependencies:

npm install

Environment variables

Configuration is done through Vite environment variables. Copy or edit .env.development in the project root:

VITE_API_BASE_URL=http://localhost:443
VITE_OAUTH_CLIENT_ID=stalwart-webui
VITE_ACCESS_TOKEN=
VITE_OAUTH_SCOPES=
Variable Description
VITE_API_BASE_URL URL of the Stalwart server. Used for all API requests during development. In production builds (when empty or unset) requests are relative to the current origin.
VITE_OAUTH_CLIENT_ID OAuth 2.0 client ID. Defaults to stalwart-webui.
VITE_ACCESS_TOKEN When set, skips the OAuth flow entirely and uses this token for all requests. Useful for local development and testing.
VITE_OAUTH_SCOPES Optional OAuth scopes. Omitted from the authorization request when empty.

Bypassing OAuth for development

Set VITE_ACCESS_TOKEN to a valid bearer token to skip the login page and go straight to the admin panel. You can obtain a token from the Stalwart server's token endpoint or use an API key:

VITE_ACCESS_TOKEN=your-bearer-token-here

Running the dev server

npm run dev

This starts Vite's development server with hot module replacement, typically at http://localhost:5173.

Testing

Run the unit tests (Vitest):

npm test

Run tests in watch mode:

npm run test:watch

Building for production

npm run build

This runs the TypeScript compiler followed by Vite's production build. Output goes to the dist/ directory.

To preview the production build locally:

npm run preview

Support

If you are having problems running Stalwart Mail Server, you found a bug or just have a question, do not hesitate to reach us on Github Discussions, Reddit, Discord or Matrix. Additionally you may purchase a subscription to obtain priority support from Stalwart Labs LLC

License

This project is dual-licensed under the GNU Affero General Public License v3.0 (AGPL-3.0; as published by the Free Software Foundation) and the Stalwart Enterprise License v1 (SELv1):

  • The GNU Affero General Public License v3.0 is a free software license that ensures your freedom to use, modify, and distribute the software, with the condition that any modified versions of the software must also be distributed under the same license.
  • The Stalwart Enterprise License v1 (SELv1) is a proprietary license designed for commercial use. It offers additional features and greater flexibility for businesses that do not wish to comply with the AGPL-3.0 license requirements.

Each file in this project contains a license notice at the top, indicating the applicable license(s). The license notice follows the REUSE guidelines to ensure clarity and consistency. The full text of each license is available in the LICENSES directory.

Copyright (C) 2024, Stalwart Labs LLC

S
Description
My custom mods to the stalwart webui
Readme
2.2 MiB
v1.1.3
Latest
2026-08-03 11:50:30 -07:00
Languages
TypeScript 94%
CSS 2%
PowerShell 2%
Shell 1.8%
JavaScript 0.1%