> ## 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.

# Microsoft 365 Monitor

Here you will learn how to integrate xorlab with your Microsoft 365 environment to monitor email traffic.

You can use xorlab to passively monitor incoming, outgoing, and internal emails. Passive monitoring is useful when you want to observe email traffic without affecting the mail flow. This approach is often used during the proof of value (PoV) phase.

> [!NOTE]
>
> We will use `example.com` as the example for an Microsoft 365 domain and we will assume that xorlab runs under `xorlab.example.com`.
>
> For a cloud deployment, we will use `mx.xyz.activeguard.cloud` in the examples.

> [!WARNING]
>
> **Prerequisites**
>
> To monitor your Microsoft 365 environment with xorlab, you will need:
>
> * Access to the Microsoft 365 Admin Center.
> * The email address of your xorlab instance, e.g., `monitor@xorlab.example.com` or `monitor@mx.xyz.activeguard.cloud`.

## Configuration

1. Go to the [Exchange Admin Center](https://admin.exchange.microsoft.com/), in its left pane click **Mail flow** and, in the expanded list of items, click **Rules**:

   ![Selecting Mail Flow Rules](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/mail-flow-rules.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=19fd7433e9822d2806a0340f39273f30)

   *Selecting Mail Flow Rules*

2. On the **Rules** screen that appears, click the plus (`+`) icon and select **Create a new rule…** from the drop-down list.

   ![Creating a new rule](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/create-new-rule.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=0503a290380db9aca5c053339f101b9c)

   *Creating a new rule*

3. A new pane opens with input fields for setting new rule conditions. Create a rule for incoming emails with the following settings:

   * Enter `IncomingBCCxorlab` in the field under **Name**.
   * Click the drop-down list under **Apply this rule if** to expand it and choose **The sender**, then click the **Select one** drop-down list on the right to expand it and select **is external/internal**, and finally choose **Outside the organization** from the **select sender location** list.
   * Click the plus icon (`+`) at the end of condition lists for **Apply this rule if** to add another condition. Click the drop-down list under the new **And** condition to expand it and choose **The recipient**, then click the **Select one** drop-down list on the right to expand it and select **is external/internal**, and finally choose **Inside the organization** from the **select recipient location** list.
   * Click the drop-down list under **Do the following** to expand it, select **Add Recipients**, then click the **Select one** drop-down list on the right to expand it and select **to the Bcc box**, and finally select the xorlab Security Platform monitoring mailbox address from the list of recipients or enter it manually, e.g., `monitor@xorlab.example.com` or  `monitor@mx.xyz.activeguard.cloud`, where `xyz` is your customer ID for your xorlab instances.

   The resulting rule conditions should look as depicted in the screenshot below:

   ![Rule settings for incoming emails](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/monitor-incoming.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=8b05df069b6ce5dd3a34b3862354f4b5)

   *Setting up a rule for incoming emails*

4. Click **Next**.

5. On the next **Set rule settings** page, leave all settings at their defaults. Click **Next**.

6. Review the settings for your rule on the last page and if they are OK, click **Finish**, then **Done** when the transport rule is created.

7. Repeat steps #2-6 to add another rule—this time, for outgoing emails: name it `OutgoingBCCxorlab`, set the sender to be from **inside** the organization and the recipient from **outside** the organization. See the screenshot below:

   ![Rule settings for outgoing emails](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/monitor-outgoing.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=67bf37d8d787c7e6578f51c94d5bf38b)

   *Setting up a rule for outgoing emails*

Now, a copy of every incoming and outgoing email will be sent to xorlab.

### Including internal emails

The above configuration monitors only the cross-border communication (incoming to and outgoing from your organization). If you want to include also internal email communication, follow steps #1-6 above, but in step #3 create just one rule for all messages by setting these properties:

* **Name:** `BCCxorlab`
* **Apply this rule if** → **Apply to all messages**
* **Do the following…** → **BCC the message to…** → select the xorlab monitoring mailbox address from the list of recipients or enter it manually, e.g., `monitor@xorlab.example.com` or  `monitor@mx.xyz.activeguard.cloud`, where `xyz` is your customer ID for your xorlab instances.

![Configuring the monitor rule](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/monitor-rule.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=71b2537f03ae628cc62ade2fe762640b)

*Configuring the monitor rule required to send a copy of all emails to xorlab*

Now, a copy of every email will be sent to xorlab.

## Monitoring mode using a connector

In addition to the integration above, it is possible to force BCC emails to xorlab through an additional connector instead of using a transport rule. This can be required in the following cases:

* You already have an existing connector that interferes with the BCC emails sent to xorlab.
* You have a hybrid MS setup with an on-prem-only email delivery (*Centralized Mail Transport*) and you would like to send the BCC emails directly with M365 to xorlab.

To set up a monitoring mode using a connector, follow the instructions on how to create an [M365 connector to xorlab](https://docs.xorlab.com/9.0/office365-inline.md#m365-to-xorlab-connector), with the only difference being a different use of connector (step #4 in the referenced article):

1. On the **Home** screen of the [Exchange admin center](https://admin.exchange.microsoft.com/#/) click **Mail flow** in the left pane and in the expanded list of items click **Connectors**:

   ![Mail flow connectors](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/mail-flow-connectors.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=592cb2115f8ff81309141f89c92e8a93)

   *Exchange admin center*

2. On the **Connectors** page, click **Add a connector**.

   ![Add a connector](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/add-connector.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=821f1ccc48434a587be91f8ab99a59ad)

   *Adding a connector*

3. Select **Office 365** under **Connection from** and **Your organization’s email server** under **Connection to** and click **Next**:

   ![New connector from O365](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/new-connector-from-o365.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=bbdee485a8113063eb314c94e12c21a0)

   *Adding a new connector from M365*

4. Set the name of the connector to `Microsoft365Toxorlab` on the **Connector name** screen and click **Next**:

   ![Connector name from M365](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/connector-name-m365.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=262c68045f1a2fc7b8189f03e911cff1)

   *Setting the connector name*

5. On the **Use of connector** page, choose the third option **Only when email messages are sent to these domains** and enter your xorlab domain as specified in the `templateDomain` property (see step #7 in [*Basic settings*](https://docs.xorlab.com/9.0/configuration-guide.md#basic-settings)), e.g., `mx.xyz.activeguard.cloud`:

   ![Use of connector](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/use-of-connector-domains.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=11081186d5bc605f75d60585ebe9ed97)

   *Defining the use of connector*

6. Click the plus (`+`) icon to add your domain and click **Next**.

7. Add a new smart host with the domain that resolves to the xorlab MTAs on the **Routing** screen by entering them and clicking the plus (`+`) button. If your customer ID for your xorlab instances is `xyz` you should add `mx.xyz.activeguard.cloud`. When you’re done, click **Next**:

   ![Routing](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/routing.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=2c3323b6fbd999d3c85cf6e6953b765e)

   *Selecting the host for delivered messages*

8. On the **Security restrictions** page activate the **Always use Transport Layer Security…** option and select **Issued by a trusted certificate authority (CA)**. Click **Next**:

   ![Security restrictions](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/security-restrictions.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=12f2ab047af4c9ee499d335830f7fecf)

   *Security restrictions*

9. Enter an email address in your connected mailbox where a validation email should be sent on the **Validation email** screen, click **Validate** and, after validation, click **Next**:

   ![Validation email](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/validation-email.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=17a8e8885c25952851d6c0b9bd2eadf7)

   *Providing the validation email address*

   > [!WARNING]
   >
   > **Unsuccessful validation**
   >
   > The connector validation might fail at this point. If this happens, save the connector without validation, and then validate the connector again.

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.