Commit Graph
367 Commits
Author SHA1 Message Date
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 378b0e996c fix: keep the browser's sign-in dialog away from uploads after the access token expired #1396 2026-10-29 14:32:27 +01:00
Linus Rath e3cd9546fc fix: stop Safari's login dialog in Lite on Stalwart when the access token expired #1396 2026-10-29 00:05:50 +01:00
Linus Rath 2b24b4503f fix: load shared accounts' folders in batched, parallel requests #1409 2026-10-28 19:15:51 +01:00
Linus Rath 935f48c450 Merge pull request #1399 from lucamzanon/perf/tag-counts-keyword-get 2026-10-28 17:02:23 +01:00
Linus Rath fba04d2251 Merge pull request #1401 from lucamzanon/perf/keepalive-while-push-healthy 2026-10-28 17:02:23 +01:00
Linus Rath 96797597c5 Merge branch 'main' into feat/org-features 2026-10-28 15:14:34 +01:00
Linus Rath 5d90a850bd Merge branch 'feat/org-recovery' into feat/org-features
# Conflicts:
#	components/email/email-list.tsx
2026-10-28 09:17:56 +01:00
lucamzanon 825f47caa1 perf: skip the keep-alive echo while the push stream is live
Every connected client sent a Core/echo every 30 seconds for as long as
the page was open, background tabs included: 120 requests an hour per
login, which on an otherwise idle night made up nearly all the traffic
a server saw. A client with an SSE stream already hears from the server
every 30 seconds, since the stream is opened with ping=30.

The keep-alive tick now skips the echo when the stream delivered an
event or a ping within the last 45 seconds and the previous echo did not
fail. A stream that goes quiet or drops lets the echo through again on
the next tick, so a lost connection is still reported and reconnected
as before, at most one tick later. Clients without a stream (no
eventSourceUrl, or over the per-tab stream budget) keep pinging every
30 seconds.
2026-10-28 09:15:36 +01:00
Linus Rath 272083399c Merge branch 'feat/org-tags' into feat/org-features
# Conflicts:
#	lib/admin/restriction-keys.ts
#	lib/jmap/client.ts
2026-10-28 09:15:17 +01:00
lucamzanon 15ec489178 perf: count tags with one Keyword/get on servers that count keywords
getTagCounts sends two Email/query per tag: 240 method calls for 120
tags, and the sidebar re-runs it after every push. A server that
advertises the keywords capability with supportsCounts already reports
each keyword's total and unread in Keyword/get, so the counts now come
from one call there, and from the queries as before everywhere else or
when that call fails.

Trash and Junk (#1156) are not subtracted on this path. Keyword/get has
no filter, and taking them out would need the two per-tag queries this
avoids. The counts are the server's own for the keyword; a gateway that
maps tags to provider labels reports what the provider shows for the
label.
2026-10-28 09:09:14 +01:00
Linus Rath f1a666777b Merge branch 'feat/org-features' into feat/org-recovery 2026-10-28 09:08:49 +01:00
Linus Rath 4d846cfc91 fix: read the whole deleted items archive newest first and only for the account shown #1319
Stalwart's x:ArchivedItem/query without calculateTotal scans ids
ascending, stops at 5000 and only then reverses them, so the newest
items of a large archive never showed, and admin accounts got every
account's items. The review of the branch also found gaps around
account switches, restores and focus.

- Read the archive in pages of 500 with calculateTotal, newest first,
  stop at a whole page older than the days limit, and offer
  "Show older" after 2000 items; detection asks for one item.
- Send the accountId filter and fall back without it on
  unsupportedFilter; keep only items of the account, never one without
  an account id.
- Ask nothing until config and policy are loaded and the policy is the
  current account's; the later check after a refusal is forced.
- Show the Trash link only when the archive holds a message inside the
  days limit; the Settings page shows whenever the server has the
  feature and says that archiving must be on in Stalwart.
- Restore: notFound leaves the list with a note, forbidden hides the
  page, results for another account are dropped, the button keeps focus.
- Forget what servers said at a full sign-out.
2026-10-28 09:08:44 +01:00
Linus Rath 33ca8efb0f fix: keep shared tags safe when members edit at once or the server fails
The first version wrote the whole tag list on every change, guessed a
group when the server wouldn't say, and treated a failed read like a
server without metadata. Now:

- Definitions are a map by tag id under `tags`, and each change patches
  one tag (`metadata/org.bulwarkmail.tags/tags/<id>`), so two members
  adding tags at once both keep theirs. Fields and colors this version
  doesn't know survive. The `{ list }` and bare-array shapes are still
  read and converted by the first save.
- Shared tags appear only for confirmed group principals. A failed
  principal lookup keeps the user's own tags and asks again later.
- "No metadata advertised" (0.16) and "the read failed" are separate.
  A failed read keeps the last good tags; a failed save keeps the change,
  says so, and sends it with the next good read after the client's
  pause.
- Push reloads wait for 5 s of quiet and skip the echo of our own save;
  a returning tab reloads definitions only, and the scan for unnamed tags
  runs once per sign-in and then at most every 30 minutes.
- The editor names its buttons after the tag, shows the delete warning
  and 44 px buttons on phones, returns focus to the edit button, and
  asks for Inbox rights only for confirmed groups.
2026-10-28 08:58:11 +01:00
Linus Rath 42b694fb2c feat: save attachments of shared and group mailboxes to Files by copying the blob on the server 2026-10-28 08:16:47 +01:00
Linus Rath 7f06ed7637 Merge branch 'feat/org-features' into feat/org-tags
# Conflicts:
#	lib/admin/restriction-keys.ts
2026-10-28 08:14:39 +01:00
Linus Rath 88f20e1ab0 fix: never lose personal templates to a deletion, a clock or a settings load elsewhere
The first version took a template missing from the account's Inbox
metadata as deleted, skipped the browser's own list once the account
held anything, wrote the marker before the settings blob had loaded,
and let a round overwrite edits made while it ran. Each of these could
drop templates, or bring deleted ones back.

Now the marker entry `org.bulwarkmail.templates` holds tombstones
(90 days, at most 8 KB, oldest dropped first) and only a tombstone
deletes; a missing entry is uploaded again. Every round merges the
browser's list in when it is this account's, each version once, minus
what a newer tombstone deleted. While settings sync hasn't loaded the
account's settings, the list isn't used and no marker is written; a
blob that loads later is merged into the account's copy. The settings
blob drops its templates only once the marker is on the server. Without
settings sync the list goes into the first account that answers only.
A round that saw changes while it ran plans again against the server as
it left it. An answer without the metadata property counts as
unsupported. Changes move `updatedAt` past the previous value, dateless
synced templates get a fixed early date, and ids that don't fit a
metadata key get a new id derived from the old one. Queued changes go
out before an account signs out; a full sign-out keeps unsent templates
and deletions.

Team templates are written only if the entry is still the version the
edit started from ("Changed by someone else"), never carry Bcc, and a
refusal is told apart by Stalwart's error type. The template manager's
lists are a real tab list with arrow keys and 44 px row buttons on
phones.
2026-10-28 07:34:25 +01:00
Linus Rath ba6e6af014 feat: recover deleted items from Stalwart's archive #1319 2026-10-28 07:27:47 +01:00
Linus Rath b049b6f470 feat: share tag names and colours in group mailboxes #1310 2026-10-28 06:43:46 +01:00
Linus Rath 5ce0f96f26 fix: read delegate sharing only for the apps that are on, with the file tree alongside 2026-10-28 06:27:07 +01:00
Linus Rath bcf4f3a7a6 feat: give a delegate access to mail, calendars and contacts in one step 2026-10-28 05:11:23 +01:00
Linus Rath 6c5aead20b feat: undo a delete to Trash, archive, move, spam report or remove from folder from its toast 2026-10-28 03:11:43 +01:00
Linus Rath 7ea0a7d58d feat: read and write account metadata for shared Bulwark data 2026-10-28 01:14:30 +01:00
Linus Rath 4b69f1307f feat: let admins scope the user policy per domain or group 2026-10-28 00:29:02 +01:00
Linus Rath b78968971c fix: send from the account's identity when the composer has no From address #1377 2026-10-27 23:23:49 +01:00
Linus Rath 0e026cab2e fix: list files on Stalwart 1.0 when the account holds more nodes than one get allows #1385 2026-10-27 23:20:07 +01:00
VasilisNtovolos ac99c68ef3 fix: reconcile confirmed permanent bulk deletions 2026-10-27 14:51:38 +02:00
Linus Rath 071d57253c fix: stop retrying calendars of an account that only shares mail on Stalwart 1.0 2026-10-26 20:48:00 +01:00
Linus Rath 47e3fd81d7 fix: create folders and upload files on Stalwart 1.0 2026-10-26 20:47:59 +01:00
Linus Rath 7677b87c5e Merge pull request #1373 from motofix/fix/1371-download-name-slash 2026-10-26 19:23:56 +01:00
Julien Béti 460343d86d fix: show inline images whose part name is a path #1371 2026-10-26 18:34:57 +01:00
Linus Rath e314e56661 fix: keep the own and a group's scheduled mail apart when their ids are the same 2026-10-26 12:26:58 +01:00
Linus Rath d355e45b77 fix: stop Send now from dropping a group identity's delayed mail back into Drafts 2026-10-26 12:26:58 +01:00
Linus Rath cf2c27157d Merge branch 'main' into feat/stalwart-1.0
# Conflicts:
#	components/contacts/contacts-app.tsx
#	components/email/__tests__/composer-discard.test.tsx
#	components/email/calendar-invitation-banner.tsx
#	components/email/email-composer.tsx
#	components/mail/mail-app.tsx
#	components/pro/pro-compose-tab-body.tsx
#	components/pro/pro-email-tab-body.tsx
#	components/ui/__tests__/avatar.test.tsx
#	components/ui/avatar.tsx
#	hooks/use-mailbox-drop.ts
#	lib/__tests__/calendar-alerts.test.ts
#	lib/__tests__/jmap-calendar-tasks.test.ts
#	lib/__tests__/jmap-send-threading.test.ts
#	lib/demo/demo-client.ts
#	lib/demo/fixtures/calendars.ts
#	lib/jmap/client-interface.ts
#	lib/jmap/client.ts
#	lib/web-push.ts
#	stores/__tests__/contact-store.test.ts
#	stores/__tests__/email-store-thread-key.test.ts
#	stores/calendar-store.ts
#	stores/contact-store.ts
#	stores/email-store.ts
2026-10-26 10:14:12 +01:00
Linus Rath 89e93e330e fix: send a sub-address of your own address from your account, not a shared catch-all 2026-10-24 17:58:45 +02:00
Linus Rath 6d459674f8 Merge pull request #1109 from hildebrandttk/fix/group-identity-sent-copy
fix: save a group identity's drafts in the group account's Drafts (#1…
2026-10-24 17:55:10 +02:00
Linus Rath ed42c5a92d fix: cancel the original scheduled send before creating its replacement on reschedule #1308 2026-10-21 19:42:56 +02:00
Stefan Hildebrandt 04efcfc1f3 fix: save a group identity's drafts in the group account's Drafts (#1090)
Drafts were always created in the primary account, so a message composed as
a group identity sat in the member's own Drafts while its Sent copy (since the
previous commit) went to the group.

- createDraft takes { accountId, previousDraftAccountId }: the draft goes to
  the account that owns the From identity (resolveSendAccountId, now public
  and briefly caching the identity lists for autosave), and the replaced
  version is destroyed in the account it lives in.
- The composer tracks draftAccountId next to draftId (save, re-resolve of
  attachment blobs, send, discard, stashed state), since draft ids are only
  unique within one account.
- sendEmail destroys the sent draft in options.draftAccountId; discarding
  (inline and Pro tab) deletes it there, through the identity's login.
- Re-opening a draft from a group/shared Drafts folder (or a stamped
  aggregate row) keeps its account.
- resolveSendAccountId is optional on IJMAPClient; without it drafts stay in
  the primary account.
- Tests: client unit tests for draft placement / replacement / send cleanup,
  E2E spec 18 draft cases (autosave + send, discard).
2026-10-19 16:33:27 +02:00
Linus Rath 100da43991 Merge pull request #1247 from lucamzanon/feat/account-archive-passwords
feat: optionally keep mailbox passwords in the account list backup
2026-10-18 14:34:31 +02:00
Linus Rath 1c8e7025e6 Merge pull request #1178 from VasilisNtovolos/fix/mixed-account-bulk-archive
fix: route bulk archive by owning account
2026-10-18 14:33:41 +02:00
Linus Rath 79d8287dfd Merge pull request #1256 from sanitz/fix/task-due-localdatetime
fix(tasks): send an all-day task's due and start as a LocalDateTime
2026-10-18 14:30:08 +02:00
Linus Rath 107d731af7 feat: remove a message from just the open folder when it is in several #615 2026-10-17 19:18:25 +02:00
Linus Rath 1ad1e31781 feat: set message priority in the composer #970 2026-10-17 19:18:23 +02:00
Linus Rath 964626794b feat: browse the company directory in contacts and the composer #1253 2026-10-16 20:46:27 +02:00
Sebastian SanitzandClaude Opus 5.5 629781ffd4 fix(tasks): send an all-day task's due and start as a LocalDateTime
The task modal and the plugin API send an all-day due as a bare date
("2026-10-14"). A task's due and start are LocalDateTimes (RFC 8984).
Stalwart accepts the bare date and echoes it back over JMAP, but the
stored iCalendar has no DUE, so CalDAV clients (phones, Thunderbird)
show the task without a date. "2026-10-14T00:00:00" with showWithoutTime
is stored as DUE;VALUE=DATE.

createCalendarTask and updateCalendarTask now complete a bare due or
start to midnight. Every write goes through them, so a task saved by an
older client gets a proper due when it moves to another account.

Tests: create, update and the cross-account move against round trips
recorded on Stalwart v0.16.24 (JMAP set, then CalDAV GET of the stored
iCalendar); times and a cleared due stay as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:30:39 +02:00
lucamzanon db38ad320e feat: optionally keep mailbox passwords in the account list backup
Part 2 of 3 of the account archive agreed in #1198. When the admin turns on
"Account List Backup: Passwords" (off by default), saving the list offers to
include the passwords of the accounts signed in here with a plain password.
They are encrypted in the browser together with the list. On restore, those
accounts are signed in to in the background, one by one, without leaving the
active account; a refused password leaves the account waiting for a sign-in by
hand, as before. OAuth and TOTP accounts are saved without a password.
2026-10-16 05:46:46 +02:00
Linus Rath 41a0716c50 Merge branch 'main' into feat/stalwart-1.0 2026-10-16 01:41:48 +02:00
Linus Rath 7eb0835834 fix: check every calendar for events within the server's request limits #1065 2026-10-15 23:54:36 +02:00
Linus Rath 2f06ef45f5 Merge pull request #1065 from sanitz/fix/tasks-only-calendar-detection
fix(calendar): detect tasks-only calendars per-calendar instead of scanning whole account
2026-10-15 23:54:35 +02:00
Linus Rath 6ef0d97900 fix: count storage quota against softLimit when the server sets one #1242 2026-10-15 14:31:09 +02:00