Commit Graph
1203 Commits
Author SHA1 Message Date
Linus Rath cbd23db2fe fix: give mail import and export their own settings section and name the upload limit as the server does
- Settings > Backup & reset gets a Mail files section for Import mail
  and Export all mail, instead of sitting under settings backup.
- The pause message names Stalwart's 50000000-byte quota as 50 MB, not
  48 MB, and the dialog and settings texts mention .ost files.
- The old import's leftovers go: expandImportableEmails and
  EML_IMPORT_ACCEPT in lib/eml-import.ts, and the strings
  email_viewer.import_email, mailbox_context_menu.import_email and
  notifications.import_email_success/_error in all 30 locales.

lib/__tests__/eml-import.test.ts loses the tests of the removed
functions; its #891 checks that an .eml and an .eml in a ZIP keep their
Date header now run against the import's own sources.
2026-11-01 07:05:02 +01:00
Linus Rath 8d48f98261 fix: keep failed messages for the next import run and stop an import that can't go on
A message that failed for a passing reason (a dropped connection, a
server error, an expired token) used to count as done, so continuing
the import skipped it for good, and a slow upload followed by a cancel
imported the messages after it twice.

- The checkpoint keeps every message that is done, also past a gap,
  and the next run of the same import tries only the rest again.
- Ten failures in a row, a full mailbox (overQuota) or a refusal
  (forbidden) stop the import with a message instead of going through
  the whole file.
- An upload without an answer pauses the import instead of failing the
  message: 30 seconds, then until the upload window ends.
- Email/import, the export's Blob/get and folder listing pass the
  client's own 429 pause by, and a 429 on them doesn't pause the rest
  of the app.
- Signing out stops the job of that account only, writes no checkpoint
  and imports nothing more afterwards; another account's sign-out
  leaves the job alone.
- One tab imports a file at a time (Web Locks), and Import waits until
  the dialog knows whether an earlier run can be continued.

The import dialog tests now wait for the Import button to be enabled
before clicking it, since it stays off during that lookup.
2026-11-01 06:37:08 +01:00
Linus Rath 15f0bd198c feat: export a folder or the whole account as mbox or ZIP 2026-11-01 05:28:58 +01:00
Linus Rath d2a83a4ee9 fix: stop proxying locale rewrites back to the server when it listens on 127.0.0.1 #1487 2026-11-01 02:41:42 +01:00
Linus Rath d781e8762e Merge branch 'feat/multi-instance' 2026-11-01 01:43:15 +01:00
Linus Rath 23b50f8268 test: read the wrapped mkdir in the Dockerfile as one command 2026-11-01 00:47:30 +01:00
Linus Rath c0c1a8f0fb test: give the config route test the logger calls config-manager now makes 2026-11-01 00:46:42 +01:00
Linus Rath ecdd2b54fe chore: name the app Bulwark Webmail in exported files, outgoing requests and the manifest 2026-11-01 00:41:21 +01:00
Linus Rath 355e57ca6c Merge branch 'feat/multi-instance' into feat/multi-instance-ext 2026-11-01 00:28:15 +01:00
Linus Rath 3c34eda260 fix: cap the cache of Stalwart admin checks so it can't grow without bound 2026-11-01 00:25:35 +01:00
Linus Rath a03f76ec85 feat: send X-Powered-By: bulwarkmail.org on every response 2026-11-01 00:21:32 +01:00
Linus Rath 2078b0a13f Merge branch 'feat/multi-instance-auth' into feat/multi-instance 2026-11-01 00:13:17 +01:00
Linus Rath 89f337c0ae Merge branch 'feat/multi-instance-admin' into feat/multi-instance 2026-11-01 00:12:24 +01:00
Linus Rath 8127640acf fix: write an office editor sign-out made during a store outage as soon as the store is back #1066 2026-11-01 00:10:09 +01:00
Linus Rath 40578f039d test: give each replica in the setup token tests a state dir of its own #1066 2026-11-01 00:09:49 +01:00
Linus Rath 47281e5156 fix: answer 503 when an impersonation link's use can't be recorded and keep used links as expiring keys #1066
The marker-write test from d28ee361c now expects the 503 path (a rejected promise) instead of false: refusing with "Token already used" sent admins looking for a replay that never happened, and the jti is now remembered in memory only after it was recorded, so a retry works once the store or state dir is back.
2026-11-01 00:07:41 +01:00
Linus Rath ff08fe50fe fix: say when an admin sign-out or password change couldn't be stored instead of answering ok or wrong password #1066 2026-11-01 00:05:15 +01:00
Linus Rath df1f5cd6a4 fix: give a pair step-up attempt back only to the windows it was counted in #1066 2026-11-01 00:05:09 +01:00
Linus Rath 0ed5fb148c fix: never write telemetry defaults over a state file that can't be read #1066 2026-11-01 00:03:34 +01:00
Linus Rath 10abf7273c test: check that pairing, the policy Bearer check and the SSO hand-off answer 503 while the shared store is down #1066 2026-11-01 00:03:20 +01:00
Linus Rath 47ec029717 fix: give a hand-off redeem back when the store fails, and hand out a sign-in whose tombstone couldn't be written #1066 2026-11-01 00:03:19 +01:00
Linus Rath 79e678716e fix: stop running the background jobs while the shared store has lost its data #1066 2026-11-01 00:02:35 +01:00
Linus Rath a87a9a5f6a fix: flush account archives to disk before they replace the old file again #1066 2026-10-31 23:59:43 +01:00
Linus Rath 37696f9cf7 fix: answer 503 on the update status routes while the shared store is down #1066 2026-10-31 23:58:21 +01:00
Linus Rath fedbd650bf test: type the pinned pairing store in the disposal tests 2026-10-31 23:57:27 +01:00
Linus Rath 6d22814e5f fix: move settings and plugin credentials that no longer decrypt aside instead of refusing every save #1066
The earlier fix answered 503 to every read and write of a settings file
or plugin vault that doesn't decrypt, so a rotated SESSION_SECRET left
the user with no way out: even disconnecting a plugin failed. Now such a
document reads as nothing stored, and the next write first moves it
aside, then saves as usual. The bytes are kept unchanged, so the data can
be restored with the old secret:

- local mode renames the file to `<file>.unreadable-<time>` next to it
- shared mode copies the document to `<id>.unreadable-<time>`, then
  deletes the original only if it is still the same document

A settings file too short to hold anything reads as nothing stored and
is written over, as before 585e10041. The 503 is now only for a shared
store that can't be reached or a file that can't be read at all.

Credentials the admin set up for a plugin no longer read the user's
vault, so they keep working when it can't be read, and the credential
list still reports their status.
2026-10-31 23:57:08 +01:00
Linus Rath 933d26f0fe fix: delete an abandoned paired app password even when nobody uses pairing for a while, and finish a sign-out that hit a store outage #1066 2026-10-31 23:56:52 +01:00
Linus Rath 68d64f5018 fix: pair the policy with its own version and keep config reloads and saves from undoing each other #1066
Fixes from the review of the admin part:
- GET /api/admin/policy reads the policy and its version together; an
  identity check waiting on the store let another replica's change pair
  the old policy with the new ETag, and a save with it then won.
- A policy save answers with the stored policy and its ETag, and the
  policy, organisation, plugins and themes pages continue from that
  instead of reading it back from an instance that may not have it yet.
- A stored policy that doesn't parse keeps its version, so a save can
  replace it instead of answering 409 forever.
- A reload of another replica's change throws when this replica's writes
  kept landing while it read, so the change poller tries again; a write
  whose reload raced it reads the document again instead of applying its
  older result.
- Dropping a deleted plugin from the policy rereads policy.json first in
  local mode, as every other write does.
- New updateAdminConfig(key, change) builds a value on the stored one.

The policy route's test mocks gain getPolicyWithVersion.
2026-10-31 23:55:17 +01:00
Linus Rath af661a06c8 fix: key refused stored passwords by a secret-keyed hash and never hold a JMAP call for the shared store #1066 2026-10-31 23:53:11 +01:00
Linus Rath 2130716d83 fix: keep the day's heartbeat when its payload can't be built and never report zero accounts while the store is down #1066 2026-10-31 23:51:19 +01:00
Linus Rath 63f4af27f5 fix: send one heartbeat when the scheduler lead moves after a stall or a crash #1066 2026-10-31 23:50:07 +01:00
Linus Rath d425a873e2 fix: keep a replica that lost the scheduler lead from rearming the heartbeat or update check #1066 2026-10-31 23:47:31 +01:00
Linus Rath 25c44e01f8 feat: carry the session-limit start and office editor revocations into the shared store on import #1066 2026-10-31 23:31:00 +01:00
Linus Rath 0261c81b16 feat: keep the session-limit start and office editor sign-outs the same on every instance #1066 2026-10-31 23:29:03 +01:00
Linus Rath a0af628a6a feat: run the telemetry heartbeat and update check on one instance of the deployment #1066 2026-10-31 23:25:12 +01:00
Linus Rath f531ef63b1 feat: print the same setup token on every instance #1066 2026-10-31 23:25:10 +01:00
Linus Rath c4ccd8f03c feat: refuse an impersonation link on every instance once it was used on one #1066 2026-10-31 23:24:24 +01:00
Linus Rath ca5f2cf09c feat: let the mobile app redeem a sign-in hand-off through any instance #1066 2026-10-31 23:19:36 +01:00
Linus Rath 291b6364c9 feat: count admin login attempts across every instance and refuse sign-in while the shared store is down #1066
The three admin login limiters (5 per address and 50 overall in one
reservation, 5 per known device) keep their numbers and still don't count
refused attempts, but live in the store: memory in this process as before,
or the shared store with several replicas. checkRateLimit and
checkDeviceRateLimit are async now; the login route awaits them and
answers 503 "Sign-in is temporarily unavailable" when the store can't be
reached. The two limiter tests gain await and reset the store's counters,
which vi.resetModules no longer clears.

The admin code tells a store outage by the error's name, since the store
may come from another bundle's copy of the module.
2026-10-31 23:18:40 +01:00
Linus Rath 26cc7c68c3 feat: let a phone pair through any instance and keep pairing secrets sealed in the shared store #1066 2026-10-31 23:16:11 +01:00
Linus Rath a048689179 feat: check admin sign-outs and password changes against the shared store on every instance #1066 2026-10-31 23:12:23 +01:00
Linus Rath fd1d90dc3a fix: stop the old telemetry timer when an admin changes consent, so one heartbeat runs #1066 2026-10-31 23:11:48 +01:00
Linus Rath eb0005f3ef feat: share telemetry and update-check state across instances, with one instance id and login count #1066 2026-10-31 23:10:30 +01:00
Linus Rath ff0d2dc6e1 feat: stop sending a refused stored password from any instance once one has seen it refused #1066 2026-10-31 23:07:12 +01:00
Linus Rath cde02f5a48 fix: refuse the old admin password everywhere right after it was changed 2026-10-31 23:07:11 +01:00
Linus Rath a1ce0d7ec8 fix: keep telemetry consent when its state file can't be read #1066 2026-10-31 23:05:14 +01:00
Linus Rath 388daf767b feat: count sign-in, pre-check, pair step-up and hand-off limits across every instance #1066 2026-10-31 23:04:05 +01:00
Linus Rath 7148dd2ded feat: keep account archives in the shared store #1066 2026-10-31 23:04:02 +01:00
Linus Rath 741983c53c feat: keep users' plugin credentials in the shared store without losing a concurrent save #1066 2026-10-31 23:00:42 +01:00
Linus Rath 9651098634 fix: keep both templates when two settings saves arrive at once #1066 2026-10-31 22:58:14 +01:00