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

# Exchange 2016/2019 Monitor

Here we show how to integrate xorlab Security Platform with your on-premise Microsoft Exchange 2016 or 2019 environment to monitor email traffic out-of-band.

In this monitoring mode, XSP will receive a copy of every incoming and outgoing email (and possible also internal emails). It will show the results and which emails would have been blocked, but it will not change the mail traffic.

It is mandatory that XSP will see a copy of every incoming and outgoing email. It is not required that it receives a copy of internal emails, but this can have a positive impact on the learning phase.

## Creating the mail flow rules

### Incoming emails

First, we need to create a mail-flow rule that sends a copy of all incoming emails to xorlab Security Platform.

1. In the Exchange Control Panel, under **Mail Flow → Rules**, create a new rule.

2. After you enter the name for the rule, click the drop-down list under **Apply this rule if…** to expand it and choose **The sender is located…** and then **is external/internal**:

   ![Selecting the sender for the rule](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/exchange-rule-sender.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=af66c7407e7c215c1a287552e1204824)

3. In the **select sender location** input box that appears (if it doesn’t, click **Select one…** next to the list), select **Outside the organization** and click **OK**:

   ![Sender from outside of the organization](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/exchange-rule-outside.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=200cc3e70ae0c8606b1c7e12388e4f91)

4. Click the drop-down list under **Do the following…** to expand it and choose **BCC the message to…**

5. A new browser tab/window opens where you can enter the xorlab Security Platform monitoring mailbox address, e.g., `monitor@mx.xyz.activeguard.cloud`. Your new rule should look like the one depicted below:

   ![Exchange rule for incoming emails](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/exchange-rule-bcc.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=836d9eb3eb9c7e86f7844cb6af9dc90c)

6. Click **Save**.

### Outgoing emails

Now we need to create another mail-flow rule that sends a copy of all outgoing emails to xorlab Security Platform.

Repeat the same steps as for incoming mails but, in step #2, select **The recipient is located…** in the first list. Now the rule should look like this:

![Exchange rule for outgoing emails](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/exchange-rule-outgoing.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=e950c8215572a7d9d286dd3d8a99e629)

After creating those two rules, a copy of all incoming and outgoing emails will be sent to XSP.

## Internal emails

In order to also send a copy of internal emails to xorlab Security Platform, the two mail-flow rules from above can be replaced with one single mail-flow rule that is applied to **all messages** (select this item from the list in step #2) as shown below. This step can be ignored if internal emails should not be forwarded to XSP:

![Exchange rule for internal emails](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/exchange-rule-internal.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=57a61d4012112c2f37b3ccac3022902d)

## Considerations

As mentioned above, in monitoring mode, xorlab Security Platform will not change the mail traffic in any way. However, if all xorlab MTAs are down or do not accept emails, it can lead to a growing email queue on the Exchange Server. If this happens, you should temporarily disable the BCC email flow rules.


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