Commit Graph
8 Commits
Author SHA1 Message Date
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 3da2f0c549 fix: split mbox files only on envelope lines that end in a date and handle very long header lines 2026-11-01 06:58:03 +01:00
Linus Rath 5238e6f5ad fix: mark streamed ZIP entries as Zip64 in their local header and refuse encrypted or damaged ZIP entries 2026-11-01 06:54:43 +01:00
Linus Rath 9d4d3261da fix: clear exported mail from the browser's storage and say plainly where an export goes
- The private file an export writes in Firefox and Safari is deleted
  when the app starts and when someone signs in, not only at the next
  export, and at once on sign-out. Close keeps it until its download
  had time to finish. Each tab holds its own files under a Web Lock, so
  one tab's sweep no longer deletes another tab's running export.
- A browser whose private file system can't write files (Safari before
  26) is told the export stays in memory instead of being promised a
  download.
- The export's live region announces only the phase and pauses; the
  count next to it no longer floods screen readers, and the format
  group is named once.
2026-11-01 06:50:13 +01:00
Linus Rath d9b62dfe9d fix: date imported mbox mail by its Date header unless the envelope line is the arrival time
Thunderbird's envelope line is when a message was copied into the folder, so a migrated folder showed years of mail on one day. The envelope date now counts only on Bulwark's own export lines and on lines with a time zone. The mbox writer tests now expect the export's own envelope sender, bulwark-export, in place of MAILER-DAEMON, which marks those lines.
2026-11-01 06:39:07 +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 d714957f98 feat: import mbox, EML and ZIP mail with progress, pause and resume 2026-11-01 04:58:55 +01:00