Creyox

Odoo Outlook Integration for Multi-Company Databases

0%

If you run more than one company inside a single Odoo database, you've likely run into a frustrating limitation: Odoo only allows one global Microsoft Outlook Client ID and Client Secret for the entire database. No matter how many companies or subsidiaries you manage, they're all forced to authenticate through the same Azure App registration.

This might not seem like a big deal at first, but it creates real problems as your business grows. Emails sent on behalf of Company B, using Company A's Outlook credentials, often fail SPF/DKIM authentication checks which means those emails can get flagged as spam or rejected outright by recipient mail servers. Beyond deliverability, there's a deeper issue: sharing access tokens and credentials across legally or operationally separate companies raises genuine security and compliance concerns.

This is where Odoo Outlook integration for multi-company databases becomes essential. Rather than forcing every company to share one Outlook connection, a proper multi-company Outlook integration in Odoo lets each business unit authenticate independently with its own Azure app, its own Microsoft 365 tenant, and its own secure OAuth2 connection.

Standard Odoo Outlook Flow vs Multi-Company Flow

Standard Odoo Flow

Multi-Company Flow

One global Client ID/Secret for the entire database

Company-wise Outlook OAuth Instances, each with its own Client ID/Secret

All companies forced onto a single shared Microsoft tenant

True multi-tenant isolation — each company can use its own Microsoft 365 organization

Emails often trigger SPF/DKIM mismatches and land in spam

Clean SPF alignment — each company sends through its own authenticated domain

Shared credentials create security and compliance risk

Independent access controls, fully isolated between companies

The difference comes down to isolation. In the standard setup, every company is technically "borrowing" the same Outlook identity. In a multi-company Outlook integration setup, each company has its own fully independent identity which is how most growing, multi-entity businesses actually need their email to work.


Key Features

A well-built Odoo Outlook integration for multi-company use should offer the following:

  • Multi-company separation of OAuth credentials — Each company gets its own dedicated Outlook OAuth Instance, keeping Client IDs, Secrets, and tokens fully isolated from other companies in the database.
  • Native hook into Odoo's mail server forms — Rather than introducing a separate, unfamiliar interface, the integration should plug directly into Odoo's existing Outgoing (SMTP) and Incoming (IMAP) mail server configuration screens.
  • Support for single-tenant and multi-tenant Azure AD apps — Whether a subsidiary uses its own dedicated Azure tenant or shares a broader organizational tenant, the integration should accommodate both Odoo multi-tenant email configuration scenarios.
  • Microsoft Graph API OAuth2 security — Authentication should run entirely through Odoo Outlook OAuth2 and the Microsoft Graph API, avoiding outdated basic authentication or stored passwords altogether.
  • Automatic background token refresh — Once authenticated, access tokens should refresh automatically in the background, so mail sending and fetching continue without manual re-logins.
  • No custom controller or redirect setup required — A properly designed module uses Odoo's standard callback routes, meaning IT teams don't need to build or maintain custom redirect URI handling.


How It Works

Setting up a multi-company Outlook integration in Odoo typically follows a simple, repeatable process:

  1. Create an Outlook Instance for each company — Within Odoo's technical email settings, set up a separate Outlook OAuth Instance for every company that needs its own connection.
  2. Enter the Azure Client ID and Client Secret — Each instance is linked to its own Odoo Azure app registration, keeping every company's credentials distinct.
  3. Copy the redirect URI into Azure — Odoo generates a redirect URI for each instance, which is then added to the corresponding Azure App registration.
  4. Link the Outgoing (SMTP) and Incoming (IMAP) mail servers — Each company's mail servers are connected to their respective Outlook Instance, rather than a shared global configuration.
  5. Authenticate the connection — Complete the OAuth2 sign-in flow for that specific company's Microsoft 365 account.
  6. Test the connection — Confirm that both sending and receiving are working correctly before rolling it out company-wide.

Once configured, the setup runs quietly in the background no manual token renewals, no shared credentials, and no cross-company email confusion.


Who Should Use This Module

This kind of Odoo Outlook integration is particularly valuable for:

  • Multi-company groups running several branches, brands, or business units from a single Odoo database.
  • Holding companies that oversee legally separate subsidiaries, each with its own domain and Microsoft 365 tenant.
  • Odoo partners and consultants managing multiple client companies within shared or hosted Odoo environments.
  • Businesses with separate Microsoft 365 tenants who need clean domain separation for security, compliance, or branding reasons.

If your organization fits any of these situations, a shared global Outlook connection is likely already causing avoidable email delivery or security issues.


Conclusion

Managing multiple companies inside a single Odoo database shouldn't mean compromising on email security or deliverability. As we've seen, Odoo's default one-Client-ID limitation forces unrelated businesses to share a single Outlook identity creating SPF/DKIM mismatches, spam issues, and unnecessary security exposure along the way. A proper multi-company Outlook integration solves this at the root, giving each company its own independent Azure app, its own Microsoft 365 tenant, and its own secure OAuth2 connection without disrupting the mail server workflows your team already knows. For any business running a multi-company or multi-tenant Odoo setup, this isn't just a nice-to-have; it's a foundational fix for keeping communications secure, compliant, and reliably delivered.

Odoo's native Outlook support only allows a single global Client ID and Secret for the whole database. If your companies use separate Azure tenants or domains, they simply can't authenticate independently without a dedicated multi-company Outlook integration.


Yes. Because each company can have its own Outlook OAuth Instance with a unique Client ID and Secret, entirely separate Microsoft 365 tenants can be connected securely, side by side, within the same Odoo database.


No. Once a company's Outlook Instance is authenticated, tokens refresh automatically in the background, so there's no need for manual re-authentication.


Yes, this type of Odoo Outlook integration typically works across both Community and Enterprise editions, whether hosted on-premise or via Odoo.sh.


Sign in to leave a comment