> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xorlab.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Pages under /latest/ document the current release. Paths that begin with a version number, for example /10.0/, are frozen snapshots of superseded releases kept for reference only — never present their instructions as current. If the reader's version is unknown, answer from /latest/ and say which version the answer describes.
> xorlab is deployed on-premises, hybrid, or as a cloud service, and integrates with either Microsoft 365 or on-premises mail infrastructure. Configuration steps often differ between these. State which deployment and integration mode an instruction applies to instead of presenting one as universal.
> Distinguish inline mode from monitoring mode when describing anything that acts on email. Monitoring mode observes a copy and cannot block or quarantine; inline mode routes mail through xorlab and can.
> Write the product name as lowercase 'xorlab'. Use the documented component names: xorlab Control Center (XCC), xorlab MTA, xorlab Sandbox (DANA), xorlab Natural Language Understanding (NLU). After the first mention, use the short forms XCC, MTA, Sandbox, and NLU. Do not use DANA as a standalone name for the Sandbox, but keep it where it is a literal string in configuration keys, container names, and hostnames.
> Do not invent configuration keys, rule parameters, list names, log properties, or API fields. If a value is not present in this documentation, say that it is not documented rather than guessing.

# Enable M365 Inline Mode

> Put xorlab in the Microsoft 365 delivery path so it can block and quarantine. Your MX records stay untouched.

The integration is done via mail flow rules and connectors.

<Warning>
  **Prerequisites**

  * Complete [Before You Begin](/latest/before-begin-integration)  and [Set Up Email Routing in xorlab](/latest/m365-smtp)
  * Have access to [Exchange Admin Center](https://admin.exchange.microsoft.com/)
  * Know your customer ID `xyz`, e.g. `xyz.activeguard.cloud`
</Warning>

## Create xorlab to M365 connector

This connector makes sure that M365 will accept emails from xorlab.

1. Go to [Exchange Admin Center](https://admin.exchange.microsoft.com/) → **Connectors** → add a connector:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/add-connector.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=5b135507ff9db7ba83e94abca10cc8f3" alt="Add a connector" style={{border: '1px solid #ddd'}} width="2304" height="1196" data-path="latest/assets/add-connector.png" />

2. **Connection from** → **Your organization’s email server**:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/new-connector.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=9c150df7b21d987fd07e8a8b1d7485e6" alt="New connector" style={{border: '1px solid #ddd'}} width="2024" height="1642" data-path="latest/assets/new-connector.png" />

3. Set the name to `xorlabToMicrosoft365` and enable **Retain internal Exchange email headers**:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/connector-name.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=c932caf93151f53d3738b045f34f74be" alt="Connector name" style={{border: '1px solid #ddd'}} width="2346" height="1554" data-path="latest/assets/connector-name.png" />

4. Choose **By verifying that the subject name…** and add `*.xyz.activeguard.cloud` where `xyz` is your customer ID:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/sent-email.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=1f69a56746e76e7aab819a0ad39ec948" alt="Authenticating sent email" style={{border: '1px solid #ddd'}} width="2022" height="1642" data-path="latest/assets/sent-email.png" />

5. **Create connector**.

## Create M365 to xorlab connector

This connector makes sure that all emails are routed through xorlab.

1. Create a new connector.

2. **Connection from** → **Office 365**, and **Connection to** → **Your organization’s email server**:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/new-connector-from-o365.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=fbdd26693cf3199cf848e6b9b5192298" alt="New connector from M365" style={{border: '1px solid #ddd'}} width="2022" height="1642" data-path="latest/assets/new-connector-from-o365.png" />

3. Set the name to `Microsoft365Toxorlab` and enable **Retain internal Exchange email headers**:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/connector-name-m365.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=5caa342398d9a3f39f09b5ea880425d3" alt="Connector name from M365" style={{border: '1px solid #ddd'}} width="2400" height="1576" data-path="latest/assets/connector-name-m365.png" />

4. Select **Only when I have a transport rule set up…**:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/use-of-connector.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=0e032407d57a8b11b74d751ba1b1402b" alt="Use of connector" style={{border: '1px solid #ddd'}} width="2022" height="1642" data-path="latest/assets/use-of-connector.png" />

5. Add a new smart host with the value `mx.xyz.activeguard.cloud`, where `xyz` is your customer ID:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/routing.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=920677950ca3ac403e7408c7b61bc644" alt="Routing" style={{border: '1px solid #ddd'}} width="2024" height="1644" data-path="latest/assets/routing.png" />

6. Activate **Always use Transport Layer Security…** and select **Issued by a trusted certificate authority (CA)**:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/security-restrictions.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=af0649578cd2b36ba4192ee4b6701d8a" alt="Security restrictions" style={{border: '1px solid #ddd'}} width="2022" height="1642" data-path="latest/assets/security-restrictions.png" />

7. Enter a company mailbox where a validation email should be sent to:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/validation-email.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=9eded4b48ed107f782f9f9396d0e99e1" alt="Validation email" style={{border: '1px solid #ddd'}} width="2024" height="1644" data-path="latest/assets/validation-email.png" />

   <Note>
     **Unsuccessful validation**

     The connector validation might fail at this point. If this happens, save the connector without validation, create the mail flow rule in the next section and then validate the connector again.
   </Note>

8. Review the connector and click **Create** when it’s OK.

## Create mail flow rules

Here we create mail flow rules that use the connector from above. The mail flow rules make sure that there is no loop between xorlab and M365.

1. Go to [Exchange Admin Center](https://admin.exchange.microsoft.com/) → **Mail flow** → **Rules** and create a new rule:

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/create-new-rule.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=f3454ae9bbe95351d75bcbc667a81d23" alt="Creating a new rule" style={{border: '1px solid #ddd'}} width="1916" height="1540" data-path="latest/assets/create-new-rule.png" />

2. Configure the rule like this:

   * **Name:** `IncomingToxorlab`
   * **Apply this rule if** → **The sender** → **is external/internal** → **Outside the organization**
   * Click the plus icon (`+`) to add another condition
   * **And** → **The recipient** → **is external/internal** → **Inside the organization**
   * **Do the following** → **Redirect the message to** → **the following connector** → choose **Microsoft365Toxorlab**
   * **Except if** → **The sender** → **IP address is in any of these ranges...** → add all IPs of the xorlab MTAs (find them in the DNS A records of `mx.xyz.activeguard.cloud`)

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/incoming-rule.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=8256468fc4e6f75a67c6bf90c6ba6788" alt="New rule" style={{border: '1px solid #ddd'}} width="1834" height="1406" data-path="latest/assets/incoming-rule.png" />

3. Click through **Next** → **Finish** and leave all settings at their defaults.

4. Repeat steps #2-3 to add another rule but this time set:

   * **Name:** ` OutgoingToxorlab`
   * **The sender** → **Inside the organization**
   * **The recipient** → **Outside the organization**
   * **Except if** → **The message properties** → **Automatic Reply**

     <Note>
       **Exclude automatic replies**

       In the outgoing rule we exclude automatic replies because M365 does not always accept them when sending them back.
     </Note>

   <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/outgoing-rule.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=5aa7b79e0960b434348cfa5a92164002" alt="Outgoing rule" style={{border: '1px solid #ddd'}} width="1369" height="1080" data-path="latest/assets/outgoing-rule.png" />

5. Enable both rules in the **Rules** page.

6. It can take several minutes until the rule is active. Test it by sending an incoming and outgoing email.

## Troubleshooting

Apply the following measures only if you experience deliverability issues between M365 and xorlab. Normally, they are not necessary.

### M365 rejects emails from xorlab

If M365 rejects some legitimate emails from xorlab, there are multiple measures. Apply them in order written below until the problem is fixed.

First, add your xorlab domain as an “[accepted domain](https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/manage-accepted-domains/manage-accepted-domains)”.

<Accordion title="Add xorlab as accepted domain">
  1. Go to [Microsoft 365 Admin Center](https://admin.microsoft.com/) → **Settings** → **Domains** and add a domain:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/add-domain.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=042ea96fbd454d81f30e9cee62897f26" alt="add-domain" style={{border: '1px solid #ddd'}} width="1754" height="1122" data-path="latest/assets/add-domain.png" />

  2. Enter `xyz.activeguard.cloud`, where `xyz` is your customer ID:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/domain-name.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=dc0a47438311834378b3ac1e25b24a1d" alt="Add a domain name" style={{border: '1px solid #ddd'}} width="2326" height="1644" data-path="latest/assets/domain-name.png" />

  3. Select the first option **Add a text record…**:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/domain-verification-method.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=fae561d8ff1ace90db940fd00abf784c" alt="Domain verification method" style={{border: '1px solid #ddd'}} width="2880" height="1544" data-path="latest/assets/domain-verification-method.png" />

  4. Send the TXT value to [support@xorlab.com](mailto:support@xorlab.com) so that we can add it to the DNS record of your domain. After this has been done, **verify**:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/domain-verification-data.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=3b1d1c82392d71b4420fdae1960b88c2" alt="Domain verification data" style={{border: '1px solid #ddd'}} width="2880" height="1544" data-path="latest/assets/domain-verification-data.png" />

  5. After a successful verification, click **More options** and select **Skip and do this later**:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/domain-skip.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=63bdb6dbacf4791aaf11f9b32cb2c228" alt="Domain skip and do this later" style={{border: '1px solid #ddd'}} width="2622" height="1142" data-path="latest/assets/domain-skip.png" />
</Accordion>

If that does not help, you can add xorlab to your SPF records.

<Accordion title="Add xorlab to your SPF records">
  You can add the xorlab MTAs to your SPF records. For this, include `a:mx.xyz.activeguard.cloud` to all your domains that route emails via xorlab:

  ```shell theme={null}
  dig +short TXT customer.tld
  "v=spf1 a:mx.xyz.activeguard.cloud include:spf.protection.outlook.com -all"
  ```

  Afterward, check that your SPF records are still valid, for example with  DMARCanalyzer’s [SPF checker](https://www.dmarcanalyzer.com/spf/checker/).
</Accordion>

If adding xorlab to your SPF record did also not help, you can add xorlab to the anti-spam policy of M365.

<Accordion title="Add xorlab to the M365 anti-spam policy">
  1. Go to [**Anti-spam policies**](https://security.microsoft.com/antispam) and select **Connection filter policy (Default)**:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/anti-spam-policies.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=7e8cadcc24bb4ae9086e9a1ca19ed99d" alt="Anti-spam policies" style={{border: '1px solid #ddd'}} width="2880" height="1642" data-path="latest/assets/anti-spam-policies.png" />

  2. Click **Edit connection filter policy**:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/connection-filter-policy.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=af926fe2f1d5f5e1487638736f5caa5c" alt="Connection filter policy" style={{border: '1px solid #ddd'}} width="1184" height="1546" data-path="latest/assets/connection-filter-policy.png" />

  3. Enter the xorlab MTA IPs to the first field:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/connection-filter-allowed-ips.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=31e5ae488e29ffa12d5269bcb34ba30d" alt="Allowed IPS for connection cilter" style={{border: '1px solid #ddd'}} width="1184" height="1546" data-path="latest/assets/connection-filter-allowed-ips.png" />

  4. Check if the addresses are correct under **IP Allow list** and click **Close**.
</Accordion>

### M365 puts emails from xorlab into Junk

The following mail flow rule will bypass the M365 spam filtering for emails coming from xorlab. Note that this will mostly disable the Junk folder mechanism for your mailboxes.

<Accordion title="Bypass spam filtering">
  1. Go to [Exchange Admin Center](https://admin.exchange.microsoft.com/) → **Mail flow** → **Rules** and create a new rule:

       <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/create-new-rule.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=f3454ae9bbe95351d75bcbc667a81d23" alt="Creating a new rule" style={{border: '1px solid #ddd'}} width="1916" height="1540" data-path="latest/assets/create-new-rule.png" />

  2. Configure the rule like this:

     * **Name:** `SpamBypassxorlab`.
     * **Apply this rule if** →  **The sender** → **IP address is in any of these ranges...** → add all IPs of the xorlab MTAs
     * Click the plus icon (`+`) to add another condition
     * **And** → **The message properties** → **include an SCL greater than or equal to** → **Bypass spam filtering**
     * **Do the following** → **Modify the message properties** → **set the spam confidence level (SCL)** → **Bypass spam filtering**

         <img src="https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/latest/assets/bypass-action.png?fit=max&auto=format&n=O_O2TUa6eRBR54aI&q=85&s=bad4fff5dd82cd4d8bf46eb5e9036e4b" alt="Bypass spam filtering actions" style={{border: '1px solid #ddd'}} width="2004" height="1636" data-path="latest/assets/bypass-action.png" />

  3. Click through **Next** → **Finish** and leave all settings at their defaults.

  4. Enable the rule in the **Rules** page.
</Accordion>

## Next steps

Optionally continue with:

* [Activate Case Isolation](/latest/m365-case-isolation)
* [Move M365 Quarantine to xorlab](/latest/m365-move-quarantine)
* [Integrate M365 Reported Emails](/latest/m365-reporting-integration)

Once the integration is complete, continue with [What to Configure Next](/latest/integration-next-steps).
