Skip to content

Conversation

@cardoso
Copy link
Member

@cardoso cardoso commented Jun 5, 2025

This PR implements domain-based Exchange server mapping for the Outlook Calendar integration, allowing users to be automatically mapped to different Exchange servers based on their email domain. This is the client-side implementation that works in conjunction with Rocket.Chat server PR #36153.
https://rocketchat.atlassian.net/browse/CONN-675

What Changed

Version-Aware Configuration System

  • Automatic server version detection: The implementation detects Rocket.Chat server version and adapts the configuration approach:
    • Pre-7.8.0 servers: Uses legacy global server settings (Outlook_Calendar_Exchange_Url)
    • 7.8.0+ servers: Uses new user-specific domain mapping from user.settings.calendar.outlook.Exchange_Url

Enhanced Injection Logic

  • Smart configuration retrieval: Modified src/injected.ts with a getOutlookSettings() helper that dynamically determines the appropriate Exchange URL based on:
    • Server version capabilities
    • User-specific domain mapping settings
    • Fallback to global settings when needed

Per-User Exchange URL Management

  • Domain-based routing: Updated IPC handlers to store and manage Exchange URLs per user ID, enabling automatic server selection based on user domain
  • Credential isolation: Each user's Exchange credentials are stored separately, preventing cross-contamination between different Exchange environments

Key Benefits

Multi-Domain Enterprise Support

  • Automatic server selection: Users are automatically connected to the correct Exchange server based on their email domain (e.g., @company1.com → Exchange Server A, @company2.com → Exchange Server B)
  • Zero configuration for end users: No manual Exchange URL configuration required - users are automatically routed to their domain's Exchange server

Seamless Integration

  • Backward compatibility: Maintains full compatibility with existing single-Exchange-server deployments
  • Transparent upgrade: Existing configurations continue working while new domain mapping becomes available on server upgrade to 7.8.0+

Enterprise Scalability

  • Multi-tenant architecture: Supports complex organizational structures with multiple Exchange environments
  • Centralized management: Administrators can configure domain mappings server-side without requiring client updates

Technical Implementation

This client-side implementation works by:

  1. Detecting the server's version and capability for domain mapping
  2. Retrieving user-specific Exchange URLs that have been calculated server-side based on domain mapping rules
  3. Managing separate credential stores per user/domain combination
  4. Providing seamless fallback to legacy global configuration when needed

This feature is particularly valuable for large enterprises, managed service providers, or organizations with complex Exchange infrastructure where different user groups need to connect to different Exchange servers based on their corporate domain.

To view the Outlook Exchange URL: Enable Developer Mode in HelpDeveloper Mode, then right-click any server icon in the sidebar and select "Server Info". The Exchange URL will be displayed in the server information panel if Outlook Calendar integration is configured for that server.

image

@jeanfbrito jeanfbrito marked this pull request as ready for review June 17, 2025 23:53
@jeanfbrito jeanfbrito changed the title feat: support mapping users to exchange servers by domain feat: Support mapping users to exchange servers by domain Jun 18, 2025
@casalsgh casalsgh requested a review from jeanfbrito June 18, 2025 14:41
@jeanfbrito jeanfbrito merged commit 8765bef into master Jun 30, 2025
9 checks passed
@jeanfbrito jeanfbrito deleted the multiple-exchange branch June 30, 2025 16:51
@github-actions
Copy link

Windows installer download

@github-actions
Copy link

@github-actions
Copy link

macOS installer download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants