Commit graph

1262 commits

Author SHA1 Message Date
Ben Gotow
97c693107e More complete handling of recurring events with exceptions 2026-01-04 14:55:48 -06:00
Ben Gotow
4195f8eb96 Use CalDAV-provided calendar colors when available 2026-01-04 12:42:12 -06:00
Ben Gotow
db259f6be1 Revert "Fix Windows spellcheck not working for en-US (#2534)"
This reverts commit 306fcf21c5.
2026-01-03 20:35:16 -06:00
Ben Gotow
f92b02f34f Implement Syncback + Destroy event tasks 2026-01-03 20:34:23 -06:00
Ben Gotow
9a87b5a5ab Remove unused files 2026-01-03 20:34:23 -06:00
Ben Gotow
306fcf21c5
Fix Windows spellcheck not working for en-US (#2534) 2026-01-03 15:51:34 -06:00
Ben Gotow
33236be6c5
Fix Download All changing filenames with hyphen-number patterns (#2531) 2026-01-02 19:50:46 -06:00
Ben Gotow
a78247af3c
Fix Linux tray icon sharing ID with other Electron apps (#2529)
Set app.setName('Mailspring') explicitly on Linux to ensure the system
tray icon gets a unique StatusNotifierItem ID. Without this, all Electron
applications share the same ID, causing KDE Plasma and other desktop
environments to synchronize tray visibility settings across different apps.

Fixes: https://community.getmailspring.com/t/tray-icon-share-id-with-different-apps-particularly-electron/14000
See: https://github.com/electron/electron/issues/40936

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-02 14:39:52 -06:00
Ben Gotow
0563c480eb
Fix notifications respecting macOS Do Not Disturb (#2525)
* Fix DND/Focus mode not silencing new mail sounds on macOS 12+

Update macos-notification-state from v1.3.6 to v3.0.0 to add proper
support for macOS Focus mode (which replaced Do Not Disturb in macOS 12).
The old version did not detect Focus mode on macOS 12+, causing sounds
to play even when the user had DND/Focus enabled.

The v3.0.0 API change requires async handling since getDoNotDisturb()
now returns a Promise, so update doNotDisturb() and displayNotification()
to be async, along with their callers in the unread-notifications package.

Fixes: https://community.getmailspring.com/t/notifications-do-not-respect-focus-mode-on-macos/9737

* Silence all sounds when macOS Focus/DND mode is enabled

Move the Do Not Disturb check into SoundRegistry.playSound() so that
all sounds are silenced when Focus mode is active, not just the new
mail notification sound. This affects:
- New mail sound
- Send button click sound ('hit-send')
- Mail sent sound ('send')

This is more consistent with user expectations - when DND is enabled,
no sounds should play from the app.

* Patches from local testing

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-02 14:29:52 -06:00
Ben Gotow
637d771d30
Fix encoding issue in 'Message Clipped - Show All' window (#2526)
When opening the full message in a new window via the 'Message Clipped -
Show All' link, Chinese and other non-ASCII characters would appear as
garbled text. This was because the HTML file was written without a charset
declaration, causing the browser to guess the encoding incorrectly.

The fix prepends a UTF-8 charset meta tag to the HTML content before
writing it to the temporary file, ensuring the browser correctly
interprets the character encoding.

Fixes: https://community.getmailspring.com/t/message-clipped-show-all-has-a-problem-with-encoding/9532

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-02 13:47:18 -06:00
Ben Gotow
5728388199
Add additional safeguards to attachment preview generation (#2523)
* Add security vulnerability assessment for quickpreview attachment chain

Document verified vulnerability chain in quick preview feature:
- XSS via unsanitized HTML from Snarkdown/Mammoth (innerHTML injection)
- Exposed privileged IPC (finishWithData/finishCapture) to renderer
- Path validation bypass via directory traversal (missing path.resolve)
- Arbitrary file write leading to persistent RCE

Includes remediation plan with prioritized fixes and testing strategy.

* Fix critical security vulnerability chain in quickpreview attachment handling

This commit addresses a critical vulnerability chain that could lead to
persistent RCE via a single malicious attachment preview.

Security fixes implemented:

1. Path Validation (CVE-like: directory traversal)
   - Use path.resolve() to normalize paths before validation
   - Add path.sep suffix to prevent prefix-matching attacks
   - Return resolved path to prevent double-resolution

2. HTML Sanitization (CVE-like: XSS)
   - Add DOMPurify library with SanitizeTransformer config
   - Sanitize Mammoth, Snarkdown, and XLSX output before innerHTML
   - Prevents script injection via malicious .md/.docx/.xlsx files

3. Opaque Tokens (defense in depth)
   - Replace direct file path exposure with cryptographic tokens
   - Token-to-path mapping stored only in main process
   - Tokens are single-use and deleted after consumption

4. Sender Validation (defense in depth)
   - Validate IPC sender URL matches quickpreview renderer
   - Reject requests from unauthorized senders

5. Content Security Policy (defense in depth)
   - Add CSP headers to preview and capture windows
   - Restrict script-src, object-src, frame-src
   - Allow external images for document preview functionality

Reported-by: Chanho Kim

* Fix memory leak in preview token system

Add cleanupPreviewToken() function and call it when preview times out
or fails. This prevents token accumulation in long-running instances.

On success, the IPC handler already deletes the token. On failure
(timeout, crash, etc.), we now explicitly clean up the unused token.

* Fix token storage in wrong process (renderer vs main)

The previewTokens Map was being stored in the renderer process (where
index.ts runs) but the IPC handlers check for tokens in the main process
(where quickpreview-ipc.ts is registered). This caused "Invalid or expired
preview token" errors for PDF and DOCX previews.

Fix: Generate and cleanup tokens via IPC handlers so they're stored in
the main process where the validation occurs.

Changes:
- Add quickpreview:generateToken and quickpreview:cleanupToken IPC handlers
- Update index.ts to call these via ipcRenderer.invoke instead of
  importing functions directly
- Make _generateNextCrossplatformPreview async to await token generation

* Remove unneeded markdown files

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-02 11:41:59 -06:00
Ben Gotow
3205b0b784
Address npm audit issues (#2522)
* Address `npm audit` issues

* Remove “new” npm version in package.json, other unused build-time deps
2026-01-01 23:11:03 -06:00
Ben Gotow
d29831d3ca
Upgrade node-emoji to latest version (#2516)
* Upgrade node-emoji from v1.2.1 to v2.2.0

Breaking changes addressed:
- Changed import from default to namespace import (v2 uses ESM)
- Replaced `NodeEmoji.emoji` object access with `NodeEmoji.search('')`
  since the `emoji` property is no longer exposed in v2
- Added caching for getAllEmojiNames() to maintain performance
- Removed @types/node-emoji as v2 includes built-in TypeScript types

* Fix issue with emoji toolbar popover

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:58:53 -06:00
Ben Gotow
879f0b3a03
Upgrade uuid module from v3 to v13 (#2521)
- Update uuid from ^3.0.0 to ^13.0.0 in app/package.json
- Remove @types/uuid (types now built-in with v11+)
- Convert CommonJS require() to ESM imports in:
  - app/internal_packages/onboarding/lib/onboarding-constants.ts
  - app/src/flux/stores/draft-factory.ts

Breaking changes addressed:
- v7+: Removed default export, now uses named exports only
- v12+: Dropped CommonJS support (ESM only)
- v11+: Written in TypeScript with built-in types

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:49:51 -06:00
Ben Gotow
c4ee0aa86f
Upgrade ical.js and ical-expander to latest versions (#2520)
* Upgrade ical.js and ical-expander to latest versions

- Update ical.js from 1.3.0 to 2.2.1
- Update ical-expander from 2.0.0 to 3.2.0
- Fix TypeScript type imports for ical.js 2.x ES module structure
- Fix getFirstPropertyValue return type handling in event-header.tsx
- Fix occurrence item access pattern in calendar-data-source.ts

The ical.js 2.x release includes ES6 module support, improved TypeScript
definitions, and various bug fixes for recurrence handling and timezone
support.

* Fix issues

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:47:59 -06:00
Ben Gotow
2ce02e2b6b
Upgrade juice module from 7.0.0 to 11.0.3 (#2519)
* Upgrade juice module from 7.0.0 to 11.0.3

Upgrade the CSS inlining library used for email composition.
No code changes required as the basic juice(html) API remains
compatible across these versions.

* Update package-lock.json for juice upgrade

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:38:08 -06:00
Ben Gotow
f1e3b0ba27
Remove node-fetch dependency in favor of native fetch (#2518)
Node.js 18+ includes native fetch, and Electron 39 uses Node.js 22+.
The node-fetch package is no longer needed.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:35:32 -06:00
Ben Gotow
24e639ce3c
Upgrade lru-cache from v4.0.1 to v10.4.3 (#2517)
Update to modern lru-cache API for improved performance:
- Use named import { LRUCache } instead of default import
- Rename del() to delete() method
- Rename reset() to clear() method

v10.4.3 is the latest version compatible with Node ^16.17.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:30:07 -06:00
Ben Gotow
6de11a74e0
Upgrade snarkdown from 1.2.2 to 2.0.0 (#2515)
Update the snarkdown Markdown parser dependency to latest version.
v2.0.0 includes bug fixes for link parsing, fenced code blocks,
strikethrough support, TypeScript typings, and code block HTML structure.

The API remains compatible - CommonJS require() returns the function
directly, so no code changes were needed.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:24:56 -06:00
Ben Gotow
c0e5d6b0e0
Update app dependencies (Phase 1 & 2 security and minor updates) (#2513)
Security fixes:
- mammoth: 1.4.19 → 1.11.0 (fixes directory traversal vulnerability CVSS 9.3)
- npm audit fix: fixes tar-fs symlink bypass and electron ASAR integrity

Safe minor/patch updates:
- dompurify: 3.0.8 → 3.3.1
- cheerio: 1.0.0-rc.6 → 1.1.2 (now stable)
- chrono-node: 2.7.6 → 2.9.0
- moment: 2.24.0 → 2.30.1
- moment-timezone: 0.5.32 → 0.6.0
- graceful-fs: 4.1.11 → 4.2.11
- underscore: 1.13.1 → 1.13.7
- mousetrap: 1.5.3 → 1.6.5
- react-color: 2.17.0 → 2.19.3
- source-map-support: 0.3.2 → 0.5.21
- rtlcss: 4.1.1 → 4.3.0
- classnames: 1.2.1 → 2.5.1
- collapse-whitespace: 1.1.6 → 1.1.7
- enzyme: 3.8.0 → 3.11.0
- enzyme-adapter-react-16: 1.9.0 → 1.15.8

Also adds plans/dependency-upgrade-plan.md documenting remaining
upgrade phases (3 & 4) for future reference.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:15:14 -06:00
Ben Gotow
5e6847ae4e
Electron v37 to v39 migration (#2514)
* Add Electron upgrade assessment for v37 to v39 migration

Comprehensive analysis of breaking changes, deprecated APIs, and required
code changes for upgrading from Electron 37.2.2 to the latest v39.x.

Key findings:
- macOS 11 support dropped in Electron 38 (min is now macOS 12)
- new-window event deprecated, needs migration to setWindowOpenHandler
- did-get-response-details event removed, needs alternative approach
- @electron/remote still compatible but represents technical debt

* Upgrade better-sqlite3 from 11.7 to 12.5

* Upgrade dependencies, re-test on macOS

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 22:03:05 -06:00
Vuk Marinkovic
d543ec25ac
Fix #1960: Bug: Mailspring was unable to create or delete the LaunchAgent file (#2509) 2025-12-29 20:22:30 -06:00
Ben Gotow
849c312713 The linux build now relies on system libtidy 2025-09-15 11:26:14 -05:00
Ben Gotow
656cc79526 Hungarian is now a manually verified language! 2025-09-14 22:09:13 -05:00
Ben Gotow
7dfa97473f Add an env var for running Intel builds on MacOS Silicon 2025-09-14 22:09:13 -05:00
Flávio Costa
11a7a6c961
Update pt-BR translation (#2504)
* Update pt-BR translation

* Update pt-BR.json
2025-09-14 13:07:13 -05:00
Impostor0729
0706c323c6
To improve the Hungarian language file of MailSpring. (#2506)
* A Mailspring Magyar nyelvi fájljának javítása

To improve the Hungarian language file of MailSpring.

* I improved it a bit.

I improved it a bit. Now it looks perfect.

* Minor modification

Minor modification
2025-09-14 13:06:05 -05:00
Ben Gotow
5339a49f4a 1.16.0 2025-07-16 08:57:12 -05:00
Ben Gotow
906b445157 Fix PDF attachment previews on Windows / Linux 2025-07-15 21:04:27 -05:00
Ben Gotow
7824bb8d4a Run npm audit fix on app dependencies 2025-07-15 20:41:27 -05:00
Ben Gotow
361cb10042 Upgrade to Electron 37.2.2 2025-07-15 20:40:00 -05:00
Ben Gotow
a729bbbbdf Sentry fix: Skip debug output from Mailsync 2025-07-15 10:34:47 -05:00
Ben Gotow
0beb5c789b Sentry fix: Don’t log auth messages to Sentry, just noise 2025-07-15 10:34:47 -05:00
Ben Gotow
24129524a1 Sentry fix: Add null checks around clientHeight calculations in attachment-items 2025-07-15 10:34:47 -05:00
Ben Gotow
d34468a0b9 Sentry fix: Make sure we don’t call utf7.imap.encode with a number 2025-07-15 10:34:47 -05:00
Ben Gotow
307dbfda32 Sentry fix: Avoid throwing when reporting an error in the editing session 2025-07-15 10:34:47 -05:00
Ben Gotow
8dcc27a170 Sentry fix: Optional chaining of err?.toString() when err can be null 2025-07-15 10:34:47 -05:00
Ben Gotow
9b91e09ff7 Sentry fix: Always gate reportError to avoid ResizeObserver errors 2025-07-15 10:34:47 -05:00
Ben Gotow
5b08d6f776 Sentry fix: Quickpreview inside app.asar bundle on snap 2025-07-15 10:34:47 -05:00
kimboslice99
232aa97545
Thunderbird Autoconfiguration (#2493) 2025-07-05 14:50:08 -05:00
Peter Dave Hello
ec16524a38
Update and improve zh-TW Traditional Chinese locale (#2498)
There were many machine-translated translations or Simplified Chinese
terms in the zh-TW translation that should have been fixed or improved.
2025-07-05 14:45:29 -05:00
tomo90
94d7b3527b
Update Czech translation (#2500)
Update Czech translation

Update Czech translation

Update Czech translation

Update Czech translation
2025-07-05 14:45:14 -05:00
Vuk Marinkovic
5974275421
Change lsb-core-noarch to be an optional dependency in the RPM package. (#2503) 2025-07-05 14:45:03 -05:00
Ben Gotow
3cde64fcd5 Fix a few misc exceptions sent to Sentry 2025-02-02 20:18:58 -06:00
Ben Gotow
cb02bf1000 1.15.1 2025-01-26 17:41:41 -06:00
Ben Gotow
c189263eb9 Update Sentry DSN, skip issues that spam the error reports 2025-01-26 17:38:11 -06:00
Ben Gotow
b08f1ceb49 Fix metadataForPluginId crash when value is null 2025-01-26 17:38:11 -06:00
Ben Gotow
6b5a74f718 Fix error on Windows for chinese users: "zh-CN" is not valid unless language pack installed 2025-01-26 17:38:11 -06:00
Ben Gotow
738fb2ec02 Remove windows “quiet hours” support since Windows 10 is EOL 2025-01-26 17:38:11 -06:00
Ben Gotow
367cca7b47 Update translations to reference updated “its” string 2025-01-26 17:38:11 -06:00