Commit Graph
320 Commits
Author SHA1 Message Date
Linus Rath dccf4e8b9f chore: merge feat/desktop-offline into the windows branch 2026-11-03 07:31:32 +01:00
Linus Rath bb2393cf04 feat: open messages and drafts in their own windows and save all attachments to a folder
An installed app had no title bar of its own, no way to save attachments
except a zip, and "pop out" stayed inside the page. A new window was a
second copy of the app that had to restore the session itself, and on
start-up that evicts any login made without "Remember me" from the list
every window shares.

- Title bar: `display_override` with `window-controls-overlay`, one
  `--titlebar-inset` variable at the page roots and skeletons, and a drag
  strip with the window title. 0 without an overlay, so nothing moves.
- Save all to a folder: `showDirectoryPicker`, asking the device policy
  before the picker and before each file, with the zip as the fallback.
- Pop-out routes `/popout/message/<id>` and `/popout/compose`, on offer in
  an installed app or when the desktop bridge has windows. Hidden in Lite.
- A pop-out borrows the main window's session and never evicts or starts a
  token timer. Every renewal now takes a Web Lock, so two windows can't
  send the same refresh token, which Stalwart 1.0 may treat as a replay.
- A draft moves to its window under the same id. A closing window hands
  unsaved text to the main window to save, since its own request wouldn't
  survive the close.
- Read state, drafts, theme and language follow across windows, and
  `html[data-desktop]` gates the app-like behaviour in `app/desktop.css`.
2026-11-03 06:50:21 +01:00
Linus Rath c65d18eaae feat: open mail, calendar and contact files from the OS and share into a new draft
The installed app only handled mailto: and webcal: launches. The launch
consumer dropped files, and nothing could hand a File to the composer or
the import dialogs, because the pending mailto is JSON in sessionStorage.

- manifest: `shortcuts` named in the browser's language, `file_handlers`
  for .eml, .ics and .vcf, and `share_target`, all with the base path and
  per-domain branding. Lite's manifest is unchanged.
- `lib/launch-handoff.ts`: the one place files and links wait, in memory
  and in the Cache API, so they survive a sign-in that leaves the page.
  The desktop bridge can call the same functions, since launchQueue never
  fires in Electron. Sign-out clears it.
- launch consumer: routes files by type, and takes a shortcut to an open
  window, which focus-existing would otherwise only focus.
- .eml opens in a new host for the preview, also before sign-in, with the
  strictest device policy deciding about saving. .ics and .vcf open their
  import dialogs through a new `initialFile` prop. A .ics needs the server,
  so offline the dialog says so and carries on once back online.
- composer: `initialFiles` goes through `addFiles`, so plugin vetoes and
  size limits still apply, also from a Pro compose tab.
- `sw.js` takes the share POST before the offline check and keeps the files
  for the page. Without a worker, `/protocol/share` passes text and links
  on and the page says the files are lost. `protocol` joins the app
  sections and the handler pages join the shell, so a mailto: launch
  offline no longer gets a network error.

Browsers without launchQueue or a service worker behave as before.
2026-11-03 05:26:01 +01:00
Linus Rath 732175772c fix: carry a plugin's template or signature change into both rich and plain-text drafts 2026-11-02 22:52:04 +01:00
Jacob Zeitz 9050724fd1 feat(plugins): task reminders reach plugins, which may show a reminder themselves
onCalendarAlert now fires for a task's display alert too, as
{ id, taskId, taskTitle, triggerTime }, and closing that reminder's toast
fires onCalendarAlertAcknowledge with { alertId, taskId }. A task's
reminder reaches only plugins with tasks:read, an event's only plugins
with calendar:read; either permission registers the hooks, and the host
hands each call only to a plugin holding the one it needs.

onBeforeCalendarAlert, a new intercept, runs before Bulwark shows a
reminder of an event or a task, with the same payload. A plugin that
shows reminders itself returns false: Bulwark then plays no sound, sets
no title alert and shows no toast for that reminder, while
onCalendarAlert still fires. Like the reminder it runs in every open
tab, and each tab follows its own answer. It fails open within five
seconds, so a hung plugin delays a reminder but never drops it. Without
a handler the reminder shows at once, as before.
2026-11-01 20:06:38 +01:00
Linus Rath e9b235bab2 Merge branch 'main' into feat/enterprise-pack
# Conflicts:
#	components/admin/admin-shell.tsx
#	lib/admin/outgoing-hosts-registry.ts
#	lib/admin/reachable-hosts.ts
#	scripts/lite/build.mjs
#	stores/policy-store.ts
2026-11-01 13:46:59 +01:00
Linus Rath b58dc1d66b fix: apply the device policy and retention line of the account whose folder is open, and keep Copy to account from moving mail out of a restricted account 2026-11-01 09:42:19 +01:00
Linus Rath e80f5ade81 feat: let admins turn off downloads, export, printing and the install prompt, and add a watermark
Organisation > Devices now sets policy.json `organisation.devices`, each
switch off by default and scoped per domain or group:

- No downloads: attachments and files only preview (reader, conversation
  view, Pro tab, list chips, .eml previews, the Files app). Download,
  Download all, Open in new tab, Save to Files, drag-out, the browser's
  PDF viewer (pdf.js instead) and media download controls go away.
- No export: no .eml export, View source, message drag-out, or folder and
  account export; a running export stops and its file is deleted when
  the switch turns on. Import stays.
- No printing: no Print buttons in mail, calendar and contacts; Ctrl+P
  prints a note; the reader frame prints blank.
- No install prompt: no card, and the browser's own banner is held back.
- Watermark: the user's address and the date over the reader,
  previews and every printout (mail, calendar, contacts, plugins).

A message follows its own account's policy; what isn't about one message
follows the strictest signed-in account. Every user path hides its
button, and the anchor and new-tab helpers refuse as a backstop
(lib/download-guard.ts), never the blob readers. The plugin APIs
`ui.downloadFile` and `ui.print` refuse too, and the office editor frame
loses `allow-downloads`.

Two assertions in components/mail/__tests__/blob-routing.test.tsx now
expect `{ kind: 'export' }` as the fifth argument of downloadBlob for an
.eml export: the export says what it is, so the backstop checks "No
export" rather than "No downloads" for it.
2026-11-01 08:52:34 +01:00
Linus Rath b99003956a feat: show an admin announcement across the apps 2026-11-01 07:51:46 +01:00
Linus Rath 13c57414a2 fix: report phishing per account from every view and keep a reported message's links off everywhere
- Pro tabs stamp a message of another login or a shared account with
  where it came from, so the report and the move use its account.
- A selection across accounts names every address its reports go to,
  and Undo says how many messages came back.
- A message the list doesn't hold runs the plugins' spam hooks too, and
  every open view shows a reported message as reported at once.
- A reported message hides its unsubscribe banner, and links are off in
  its attachment previews.
- Search results and All mail don't offer reporting the user's own sent
  mail; the Mountain View selection bar offers it.
- The focus goes back to the button that opened the menu.
- ARF names the delivered-to address (or leaves it out), says binary for
  bare line breaks and long lines, and refuses a message bigger than the
  server's upload limit before downloading it.

The phishing tests that compared one address now compare the list of
addresses, and the ARF builder test passes the encoding, not a flag.
2026-11-01 07:07:30 +01:00
Linus Rath 128f61646e fix: hold remote content per account and until scoped locks are known, also in previews and drafts 2026-11-01 06:42:46 +01:00
Linus Rath 50f95f4463 feat: report a message as phishing and move it to Junk 2026-11-01 04:58:01 +01:00
Linus Rath 84de2395f0 fix: keep trusted senders from loading remote content anywhere while the organisation blocks it 2026-11-01 03:27:49 +01:00
Linus Rath cba1109444 feat: report browser and server errors to an error tracker the admin sets
Admins had logs and nothing else: client errors only reached the
browser console. An admin can now set a Sentry-protocol address (DSN)
for Bugsink, GlitchTip or Sentry under System > Monitoring, or with
`ERROR_REPORTING_DSN`, `ERROR_REPORTING_DSN_FILE`,
`ERROR_REPORTING_SAMPLE_RATE` and `ERROR_REPORTING_ENVIRONMENT`.
Bulwark Lite reads the same from `errorReporting` in policy.json.
Everything stays off while no address is set.

- browsers report errors from the error boundaries, window.onerror,
  unhandled rejections and failed JMAP requests (method and error type
  only), with route and JMAP method breadcrumbs and the chunks' debug IDs
- the server reports what Next hands to onRequestError and what routes
  log with logger.error
- every report is scrubbed first: quoted text, addresses, URLs, file
  names, tokens and the rest after the first line are removed, and the
  server scrubs what browsers post to /api/errors again
- reports are deduplicated and rate-limited per session and process
- errors are counted per day for "errors today" on the admin page
- startup messages and audit entries go through the logger, so
  `LOG_FORMAT=json` covers them
2026-11-01 02:50:19 +01:00
Linus Rath be7fde157e test: expect the Pro shell to load shared folders with each login's own 2026-11-01 01:23:34 +01:00
Linus Rath 4842e08cde fix: show shared mailboxes under each account when several are signed in #1486 2026-11-01 00:24:57 +01:00
Linus Rath f8805b8d52 fix: keep remote content blocked for trusted senders when the organisation locks it to block 2026-10-31 17:32:24 +01:00
Linus Rath 5931cd1678 feat: send an oauth resource indicator when one is configured #1461 2026-10-31 16:14:35 +01:00
Linus Rath 4887ed457c fix: stop list toolbar timers from firing after the toolbar is gone 2026-10-31 02:28:55 +01:00
Linus Rath 605a3983b1 feat: show a warning shield instead of the sender icon when the sender check fails 2026-10-29 21:13:36 +01:00
Linus Rath 50b3ddccec feat: let admins keep the refresh token valid on sign-out so Stalwart keeps the consent #1388 2026-10-29 20:47:18 +01:00
Linus Rath 0b4e501142 feat: make the login email placeholder configurable #1423 2026-10-29 20:24:26 +01:00
Linus Rath b22968a7df fix: show the message list, not only the reader, with a large browser text size and wrap cut-off labels 2026-10-29 19:38:45 +01:00
Linus Rath a1ee9035de fix: scroll without gliding when reduce motion is on 2026-10-29 19:38:45 +01:00
Linus Rath be423637fc feat: show one column and an optional paged message list in simple mode 2026-10-29 19:14:41 +01:00
Linus Rath 623c9e1792 feat: let operators set accessibility statement, barrier report, help, Easy Read and sign language links 2026-10-29 18:27:35 +01:00
Linus Rath 84c487e6c3 fix: give each settings and admin page its own tab title and translate the admin page list 2026-10-29 18:02:58 +01:00
Linus Rath af3019ea2b feat: read a message aloud with the browser's voice, highlighting what it reads 2026-10-29 17:53:58 +01:00
Linus Rath bb78697981 feat: pause animated images in mail with a play button 2026-10-29 17:53:57 +01:00
Linus Rath 3c4d63006c feat: scale wide mail down to the pane on any screen with fit wide mail on 2026-10-29 17:53:56 +01:00
Linus Rath 8cc0f8f258 feat: keep message lines to about 80 characters with the comfortable reading width 2026-10-29 17:53:56 +01:00
Linus Rath dcc0d600f4 feat: show HTML mail in the app's font, colours and spacing when styles are overridden 2026-10-29 17:53:56 +01:00
Linus Rath 24a13cc1f8 fix: stop animations inside mail when reduce motion is on 2026-10-29 17:53:55 +01:00
Linus Rath 324a0f76b2 fix: leave mail colours to the browser in Windows contrast themes 2026-10-29 17:53:55 +01:00
Linus Rath c07ba1a370 feat: show message bodies at the chosen text size and enlarge text below the minimum 2026-10-29 17:53:55 +01:00
Linus Rath cf4d02b49b feat: draw calendar, tag and folder colours in a colour-blind-safe palette when that setting is on 2026-10-29 17:53:51 +01:00
Linus Rath 23813be9b9 feat: tell screen readers when a folder or search has loaded and when the connection drops 2026-10-29 17:53:50 +01:00
Linus Rath d713d31af3 feat: announce how much new mail came and flash the tab title slowly with visual alerts 2026-10-29 17:53:49 +01:00
Linus Rath 4af4404962 feat: undo the last mail actions with Ctrl+Z or z, newest first 2026-10-29 17:53:46 +01:00
Linus Rath 8d2ebccf08 feat: keep undo toasts, errors and reminders as long as the notification duration says 2026-10-29 17:53:45 +01:00
Linus Rath e2fc2c750a feat: read toasts out to screen readers, errors assertively 2026-10-29 17:53:44 +01:00
Linus Rath 13d697ddfb feat: turn off every single-key shortcut when the setting is off 2026-10-29 17:53:34 +01:00
Linus Rath 368acca121 fix: stop app shortcuts from acting behind open dialogs and menus 2026-10-29 17:53:33 +01:00
Linus Rath d42fc053dd fix: let Escape close a dialog right after its form closed 2026-10-29 15:35:36 +01:00
Linus Rath 69d2f35d78 fix: keep the install card off the send button and remember not now #1411 2026-10-29 14:32:43 +01:00
Linus Rath f12a13e1fd feat: create documents in the formats the document editor can edit from New file #1393 2026-10-29 00:01:13 +01:00
Linus Rath 96797597c5 Merge branch 'main' into feat/org-features 2026-10-28 15:14:34 +01:00
Linus Rath 9a4f46f553 fix: show the first hour label whole under the day header when the day and week views open 2026-10-28 13:06:49 +01:00
Linus Rath e654eadd37 Merge branch 'main' into ux/mail3 2026-10-28 11:10:56 +01:00
Linus Rath 8566cf2b29 Merge branch 'ux/calendar3' 2026-10-28 11:06:37 +01:00