Commit Graph
1501 Commits
Author SHA1 Message Date
zisisvakras 816cd1bf56 test(jmap): cover the Email/set keyword removal patch shape
Extend the existing keyword write coverage to pin the three call sites
that clear a keyword. markAsRead, batchMarkAsRead and toggleStar must
patch with null and never with false, and must still send true when
setting the keyword.

The three removal cases fail against the previous boolean form, one per
call site. The three set cases pass either way, since that path was
already correct.
2026-08-17 15:26:41 +03:00
zisisvakras be97c8bf08 fix(jmap): remove keywords with null rather than false in Email/set
markAsRead, batchMarkAsRead and toggleStar cleared a keyword by patching
it to false, sending keywords/$seen: false or keywords/$flagged: false.
RFC 8620 section 5.3 removes a property from a PatchObject by setting it
to null, and RFC 8621 section 4.1.1 defines the keywords map as holding
true for every key, so false is not a valid way to clear one.

A server that enforces this rejects the update with invalidProperties.
The client does not inspect notUpdated, so marking a message unread or
removing a star looked like it had worked, the sidebar counts moved, and
the next refresh restored the old state from the server. Stalwart accepts
both forms, which is why this went unnoticed.

Send null instead, matching removeKeyword and the integration test
helpers, which already patch keywords this way.
2026-08-16 20:36:37 +03:00
Linus Rath 5ab5749306 Merge pull request #802 from dealerweb/fix/keep-alive-test-mock
test: serve a fresh mock response per fetch in the keep-alive test
2026-08-16 13:28:21 +02:00
Linus Rath 527872cc13 Merge pull request #773 from dealerweb/fix/mailto-unsaved-draft-guard
fix: route mailto composer replacement through the close guard
2026-08-16 03:08:44 +02:00
Linus Rath 1e2a4ffb00 Merge pull request #801 from dealerweb/fix/i18n-locale-wiring
fix(i18n): complete the Catalan and Mongolian locale wiring
2026-08-16 03:06:17 +02:00
Linus Rath 47cf0ed90d feat: rework pro split-screen shell, per-pane tab strips, drag & drop, pane-scoped overlays 2026-08-16 03:03:40 +02:00
Linus Rath 3a6d14871f fix: reach the tag and move sub menus in the mobile more actions menu #779 2026-08-16 02:41:56 +02:00
Linus Rath 8e3b4e71a1 fix: open right conversations in shared mailbox #814 2026-08-16 02:19:04 +02:00
Linus Rath e6597542fd fix: include email templates in cross-device settings sync #825 2026-08-16 02:09:38 +02:00
Linus Rath 89139b4055 fix: keep the signature in saved drafts 2026-08-16 01:50:39 +02:00
Linus Rath 413dd54bcf Merge branch 'main' of https://github.com/bulwarkmail/webmail
# Conflicts:
#	stores/auth-store.ts
#	stores/settings-store.ts
2026-08-16 01:27:40 +02:00
Linus Rath 1213c90f23 Merge pull request #824 from paulhenry46/rangeHeader
feat: allow privileged plugin to fetch only a range of blob
2026-08-15 19:45:56 +02:00
Paulhenry Saux a5a12e11bc feat: allow privileged plugin to fetch only a range of blob 2026-08-15 18:28:05 +02:00
Linus Rath 4d3ad6b009 Merge pull request #815 from paulhenry46/isActive-fix
feat(plugin): add isActive property to AccountResponse in plugin API
2026-08-14 18:16:12 +02:00
Paulhenry Saux 1e62029b6c feat(plugin): add isActive property to AccountResponse in plugin API 2026-08-14 13:26:08 +02:00
Linus Rath 6d0197fb24 Merge pull request #812 from hildebrandttk/chore/mn-locale-key-parity
chore(i18n): drop 4 orphan keys from the mn locale
2026-08-13 23:59:28 +02:00
Linus Rath 6dc344f547 Merge pull request #811 from hildebrandttk/fix/files-stale-data-on-account-switch
fix(files): reset the account-scoped Files drive on every account switch
2026-08-13 23:59:12 +02:00
Linus Rath 28c5876a0c Merge pull request #809 from hildebrandttk/fix/identities-consistent-namespacing
fix(identities): namespace all accounts consistently in the Pro composer
2026-08-13 23:58:12 +02:00
Linus Rath 9dba5902ae Merge pull request #808 from hildebrandttk/fix/fetch-emails-unified-guard
fix(email): route unified/cross virtual ids through the fan-out in fe…
2026-08-13 23:57:58 +02:00
Linus Rath 0f3cf0e7ea Merge pull request #807 from hildebrandttk/feat/event-editor-end-follows-start
feat(calendar): move the end with the start, keeping the event's length
2026-08-13 23:57:37 +02:00
Stefan Hildebrandt 2c688c3469 chore(i18n): drop 4 orphan keys from the mn locale
mn/common.json carried 4 keys absent from the en reference
(login.setup_guide, language.mn, language.mongolian,
language.switch_to_mongolian), failing the key-parity test. They are unused in
source and not present in any other locale (Mongolian is not wired into the
language switcher in en), so remove them to restore parity.

translations.test green (50).
2026-08-13 23:03:59 +02:00
Stefan Hildebrandt 5c06ae8bc2 fix(files): reset the account-scoped Files drive on every account switch
The Files store was the only account-scoped store never wired into the
account lifecycle: account-state-manager clears email/contacts/calendar/
filter/identity/vacation on a switch, but not files. Because the Files
store is a global that outlives the FilesApp component, the previous
account's client + resources lingered in memory and resurfaced whenever
the drive was reopened after a switch - most visibly when the switch
happened on the mail view (FilesApp unmounted), the common normal-shell
flow that the FilesApp re-init effect alone does not cover.

Clear the Files store centrally in clearAllStores() alongside the other
account-scoped stores, so the reset happens on every switch path.

Tests:
- lib/__tests__/account-state-manager.test.ts: assert clearAllStores()
  resets the Files drive (client, resources, pathStack, selection,
  supportsFiles) with no cross-account leak.
- integration/tests/13-files-account-switch.spec.ts (dockerized Stalwart,
  JMAP FileNode): seeds a distinct top-level folder in alice's and bob's
  drives and asserts the on-screen drive swaps on a switch with no stale
  folder - both switching off the Files view (mail -> switch -> open
  Files) and on it (rail account switcher). Verified: passes with the fix,
  fails (path 1) without it. New FileNode seeding helpers in helpers/jmap.ts;
  openFiles/openMailView/driveEntry nav helpers in helpers/app.ts.
2026-08-13 23:01:41 +02:00
Stefan Hildebrandt 44cdd083a3 fix(identities): namespace all accounts consistently in the Pro composer
Follow-up to the calendar/contacts consistent-namespacing fix. The multi-account
identity aggregation left the ACTIVE account's identity ids raw while namespacing
the others, so an identity id changed form when the active account changed. Now
every aggregated account is namespaced (`<accountId>::<id>`), matching the
calendar/contact stores.

Safe: the composer already resolves the raw id + owning client via
stripCrossAccountIdentityPrefix everywhere it hits JMAP (currentIdentityRawId /
composerClient), reply-identity resolves by email, and preferredIdentityIds is
applied against the raw identity store (unaffected). No consumer relies on the
active account's identity id being raw. Single-account mode (hook disabled) keeps
the store's raw ids.

Full unit suite + typecheck clean.
2026-08-13 21:31:50 +02:00
Stefan Hildebrandt b63b227645 fix(email): route unified/cross virtual ids through the fan-out in fetchEmails (#791)
fetchEmails sent a unified/cross view's client-only virtual mailbox id
(__cross_all__ / __unified_*) straight to getEmails as `inMailbox`. The server
rejects it (Stalwart: "filter.inMailbox = '__cross_all__'") and the foreground
catch wiped the list to "no messages found" - notably after actions (mark read,
delete, move) in the aggregated views.

Mirror the loadMoreEmails / refreshCurrentMailbox guard: when the target id is
virtual, fan out via fetchCrossViewEmails / fetchUnifiedEmails (search-aware) at
page 0 instead of querying the virtual id. If the view state isn't resolved yet,
stop loading without sending the id or wiping the list. Real folders are
unaffected.

+5 unit tests (email-store-fetch-unified): cross/unified fan-out, explicit
virtual-id arg, unresolved-view no-op, and the real-folder path still using
getEmails. tsc + eslint clean; all store suites green (389).
2026-08-13 21:27:24 +02:00
Stefan Hildebrandt fa76bb895d feat(calendar): move the end with the start, keeping the event's length
Editing an event's start now shifts the end by the same amount, preserving the
current duration (end - start). Moving the start forward never leaves the end
before it, and moving it either way never silently changes the length. Guards
against an already-negative-duration state.

Extracted a pure `shiftedEnd(oldStart, oldEnd, newStart)` for the start
date/time onChange handlers. +7 unit tests. tsc + eslint clean.
2026-08-13 21:24:09 +02:00
Linus Rath f2365e66cc Merge pull request #798 from ctaoist/keywords
feat: expose label reordering to extensions
2026-08-13 16:30:07 +02:00
Ctaoist b09d5c857d fix: make label reordering atomic 2026-08-13 21:17:05 +08:00
dealerweb 556b320e26 test: serve a fresh mock response per fetch in the keep-alive test
The keep-alive test parked one shared Response instance in
mockResolvedValue, but a Response body is single-use - as soon as more
than one request lands in the 30s window the second read dies with
"Body is unusable" and the ping reports a lost connection. Serve a
fresh Response per call via mockImplementation, the pattern the rest
of this file already uses.
2026-08-13 11:57:38 +02:00
dealerweb 20f157b1e7 fix(i18n): register the Catalan and Mongolian messages in the client provider
The client-side IntlProvider keeps its own build-time message map next
to the ones in i18n/routing.ts and i18n/request.ts, and ca and mn never
made it in. Picking either language merged an empty object over the
English base, so the UI stayed English no matter what the picker said
(#756); the server request config and routing both knew the locales,
the client map was the only gap. Register both and pin the map to the
routing list with a test so a locale cannot ship half-wired again.
2026-08-13 11:52:47 +02:00
dealerweb 7bc872d759 fix(i18n): register the Mongolian language keys in every locale
The Mongolian locale added language.mn, language.mongolian and
language.switch_to_mongolian only to mn/common.json, so every other
locale failed the translations completeness check (extra keys absent
from en). Add the three keys to all locales - native name for mn and
mongolian, localized wording for switch_to_mongolian, following the
Farsi entries - and drop mn's login.setup_guide, which no code
references and no other locale carries.
2026-08-13 11:52:47 +02:00
dealerweb 4e6043cf56 test: cover the failed-save rescue dropping the close follow-up
When the server refuses the draft save, the composer resets its explicit-
close flag so the unmount stash hands the text to the continue-draft slot
(#702). The close follow-up must be dropped in that case - running it
would open the new session on top of the rescue. This was the one branch
of the close guard without a test.
2026-08-13 11:00:13 +02:00
dealerweb 9ff14f5781 fix: route mailto composer replacement through the close guard
Opening a mailto: link while the composer held unsaved text used to
replace the session outright and drop the text on the floor. The mailto
entry point now hands a follow-up to the composer's dirty-aware close
handler, so the "Save or discard draft?" dialog runs first: save and
discard continue into the mailto draft, cancel leaves the current draft
untouched. When a failed save hands the text back to the continue-draft
slot (#702), that rescue wins and the follow-up is dropped.
2026-08-13 11:00:13 +02:00
Ctaoist 6e792f8834 feat: expose label reordering to extensions 2026-08-13 10:59:45 +08:00
Linus Rath 70383dea18 Merge pull request #796 from lucas-gaitzsch/fix/scheduled-send-polish
fix: polish scheduled send follow-ups
2026-08-12 18:12:28 +02:00
Linus Rath c6f3fffab5 Merge pull request #717 from dealerweb/fix/data-uri-allowlist-media-tags
fix: apply the data: URI allowlist to media tags too
2026-08-12 18:09:21 +02:00
Linus Rath 1cfbc48a9d Merge pull request #784 from zisisvakras/fix/relative-namespace-i18n
fix: scope separate translation hooks instead of relative namespace p…
2026-08-12 18:08:38 +02:00
Linus Rath 8ca553f92a Merge pull request #789 from ctaoist/mail-gateway
feat: expose label settings to extensions
2026-08-12 18:08:12 +02:00
Linus Rath 874f0647ff Merge pull request #783 from zisisvakras/fix/principal-owner-capability
fix: check the specific capability a request declares, not a broader one
2026-08-12 18:07:20 +02:00
dealerweb b11c3e8932 fix: apply the data: URI allowlist to srcset candidates too
DOMPurify URI-tests srcset as a single string, so an allowed first
candidate waved every later one through - an SVG data: URI could ride
in behind a raster candidate on <img srcset> and <picture><source>.
Check every data: occurrence against the raster allowlist and drop the
whole attribute on one disallowed hit, including the external blocker's
data-blocked-srcset stash, which shares the hook pass with no ordering
guarantee. The token is captured through the metadata-ending comma so
the plain (non-base64) raster form keeps the same verdict as in src.
2026-08-12 17:47:51 +02:00
Lucas Gaitzsch 17f18e378e fix: polish scheduled send follow-ups 2026-08-12 17:46:51 +02:00
zisisvakras 07ce2d0139 fix: scope separate translation hooks instead of relative namespace paths
next-intl has no "../" relative-namespace escape. A key like
t('../context_menu.not_spam') is not resolved relative to anything -
it is concatenated literally into the lookup key and always misses,
throwing MISSING_MESSAGE. email-list.tsx, about-data-settings.tsx,
and account-settings.tsx all used this pattern to reach keys outside
their own translation namespace.

Fixed by calling useTranslations() again for each additional
namespace needed, which is the supported way to reach sibling
namespaces, instead of trying to walk out of the current one.

The translations test already verifies that every key referenced in
source resolves in the en locale, but its extractor skipped any key
starting with a dot, which is exactly the shape of the broken calls,
so this class of bug never failed CI. Since no legitimate key can
start with a dot, the exclusion is removed. With it gone the test
reports all thirteen call sites fixed here when run against the old
code, and passes with the fix, so a reintroduced relative path fails
CI with the offending file listed.
2026-08-12 17:53:35 +03:00
Ctaoist 01ef9240d4 refactor: generalize JMAP keyword capability 2026-08-12 22:47:00 +08:00
zisisvakras 44360024bc fix: check the specific capability a request declares, not a broader one
contactUsing(), calendarUsing(), and fileUsing() checked the base
"principals" capability but then declared the separate
"principals:owner" sub-capability (RFC 9670) in the request's "using"
array. RFC 8620 section 3.3 requires a server to reject the whole
request if it declares a capability the server does not advertise, so
a server that supports base principals without the owner
sub-capability rejects every one of these requests with
unknownCapability.

Fixed to check the specific sub-capability being declared instead of
assuming it from the broader one. The calendar agenda route had the
same mismatch and is fixed the same way. Note that RFC 9670 section
1.5.2 places principals:owner in accountCapabilities rather than the
session capabilities, so on compliant servers the sub-capability is
simply never declared, which is the intent. Nothing is lost by
omitting it.

The file share test asserted the old behavior by expecting the owner
capability to be declared against a server that advertises only base
principals. It now asserts the capability is omitted in that case and
declared only when the server advertises it. The same pair of
assertions is added for the contacts, calendars, and agenda route
request builders, so each site this commit touches is covered against
regression.
2026-08-12 17:34:20 +03:00
Ctaoist f1fdb24c8c feat: emit mailbox refresh hook 2026-08-12 22:08:09 +08:00
Ctaoist cf89eaad27 feat: expose gateway keywords to extensions 2026-08-12 21:40:02 +08:00
Ctaoist ddfd9e43e6 feat: expose JMAP keyword helpers to extensions 2026-08-12 20:43:55 +08:00
Linus Rath 6d827e430f Merge pull request #782 from zisisvakras/fix/relative-urls
fix: resolve relative session URLs against the server origin
2026-08-12 14:41:28 +02:00
zisisvakras 37f830daa7 fix: resolve relative session URLs without corrupting URI templates
RFC 8620 does not require Session object URLs to be absolute, but
rewriteSessionUrl() called new URL(url) with no base, which throws on a
relative apiUrl or downloadUrl. The throw was silently caught and the
raw relative string returned, so requests resolved against the app's
own origin instead of the JMAP server.

Resolving with the URL parser and reading back href or pathname is not
an option: downloadUrl, uploadUrl and eventSourceUrl are RFC 6570
level 1 URI Templates (RFC 8620 section 2) whose literal {accountId},
{blobId}, {name} and {type} placeholders would be percent-encoded to
%7B/%7D, silently defeating the string replace() expansion at every
call site. Instead, anchor the path, query and fragment of the original
string at the server origin, which also covers network-path references
(//host/path) and does not fold a path prefix on the configured server
URL into relative resolution.

An empty URL is returned untouched: rewriting it into the bare server
origin would make it truthy and defeat the "not available" guards on
apiUrl and downloadUrl downstream.
2026-08-12 15:10:37 +03:00
Ctaoist f2c379b929 feat: expose label settings to extensions 2026-08-12 15:38:05 +08:00
Linus Rath 5e73633a80 Merge pull request #777 from hildebrandttk/fix/consistent-cross-account-id-namespacing
Fix/consistent cross account id namespacing
2026-08-11 17:37:55 +02:00