Skip to content

feat(email): expand email client detection & add Outlook edition helper#819

Merged
faisalman merged 6 commits into
faisalman:masterfrom
hey-casey:master
Jan 12, 2026
Merged

feat(email): expand email client detection & add Outlook edition helper#819
faisalman merged 6 commits into
faisalman:masterfrom
hey-casey:master

Conversation

@hey-casey

Copy link
Copy Markdown
Contributor

Prerequisites

Type of Change

This PR significantly expands the library's ability to detect Email Clients (adding support for 40+ new user agents) and introduces a helper utility to distinguish between specific Microsoft Outlook editions (MSI vs. Click-to-Run vs. Mac) which have different rendering engines.

Description

1. Email Client Detection (src/extensions/ua-parser-extensions.js)

  • Expanded Regex: Added support for over 40 distinct email clients including Alpine, Canary Mail, FairEmail, ProtonMail Bridge, The Bat!, Tuta (Tutanota), and more.

  • Normalization: Implemented name normalization for fragmented User-Agents, such as Yahoo Mail, K-9 and Zimbra.

  • Robustness: Improved parsing for Android Mail (Android/9-email) and clients with non-standard separators.

2. Outlook Helper (src/helpers/ua-parser-helpers.js)

  • Added getOutlookEdition(name, version) utility function.

  • Why: "Outlook 16.0" is ambiguous, and most uses for parsing Outlook user agents involve email developers understanding supported email code per version. This helper analyzes the build number to distinguish between:

    • Outlook 2016 (MSI): Older rendering engine (no SVG support).

    • Outlook 2019/365 (Click-to-Run): Modern rendering engine.

    • Outlook for Mac: WebKit-based engine.

3. Enums (src/enums/ua-parser-enums.js)

  • Added BrowserName.Email constants for all newly supported clients to ensure consistent usage across the library.

4. Type Definitions (src/helpers/ua-parser-helpers.d.ts)

  • Added TypeScript definition for getOutlookEdition.

Test

Please describe the tests that you ran to verify your changes.

  • New Test Suite: Updated test/data/ua/extension/email.json covering all new User-Agents.

  • Unit Tests: Added specific tests in test/unit/submodules/helpers.spec.js to verify getOutlookEdition logic against known Windows and Mac version strings.

  • Verification: Verified that normalization maps correctly output standard names (e.g., "Yahoo Mail").

Impact

Does this PR introduce a breaking change? What changes might users need to make due to this PR?

No anticipated breaking changes, as this is only meant to extend existing email extension support.

Other Info

Casey Grimes and others added 6 commits January 9, 2026 10:45
… 40+ new user agents, including Alpine, Canary Mail, FairEmail, ProtonMail Bridge, Tutanota, and The Bat!

feat(helpers): added getOutlookEdition() utility to interpret raw version strings into specific Outlook editions (e.g., distinguishing Outlook 2016 MSI vs. Click-to-Run/365).

chore(enums): added comprehensive BrowserName.Email enums for all newly supported clients.
chore(types): added TypeScript definitions for the new getOutlookEdition helper.

test(email): added comprehensive test suite covering 60+ email client user agent strings.

test(helpers): added unit tests for getOutlookEdition covering Windows (MSI/C2R) and Mac variants.
chore(deps): npm vulnerability fix in package-lock.json
chore: Updated dist builds
Fix comment formatting and clean up code.

@faisalman faisalman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is quite a list, thanks! 👍

@faisalman
faisalman merged commit bab55a2 into faisalman:master Jan 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants