# Create SDR rule in Exchange Online

## Introduction

This document explains how to configure mail flow rules for Secure Direct Replies in Exchange Online. You will set up two rules for Secure Direct Replies:

1. **An exemption rule** to exclude messages that should not be processed by the Secure Direct Replies rule.
2. **The Secure Direct Replies rule** to handle Secure Direct Reply messages.

The following chapters will guide you through setting up these two rules.

## Exemption rule

In this chapter we explain how to set up the Exemption rule for Secure Direct Replies.

### Getting started

1. Login at the [Exchange admin center](https://admin.exchange.microsoft.com/#/homepage) with your admin account.
2. Open _mail\_outline_ **Mail flow**.
3. Click **Rules**.
4. Click _add_ **Add a rule**.
5. Click **Create a new rule**.
6. Enter `Zivver: Detect processed messages` as the name.

### Set mail flow rule condition

01. Open the **Select one** dropdown menu under **Apply this rule if \***.
02. Select **The message headers…**.
03. Open the **Select one** dropdown menu next to it.
04. Select **matches these text patterns**.
05. Click **Enter text**.
06. Enter `X-Zivver-Transport`.
07. Click Save.
08. Click **Enter words**.
09. Enter `..*.` (that is 2 dots, 1 asterisk/wildcard, 1 dot).
10. Click Add.
11. Click Save.

### Set mail flow rule actions

01. Open the **Select one** dropdown menu under **Do the following \***.
02. Select **Modify the message properties**.
03. Open the **Select one** dropdown menu next to it.
04. Select **set a message header**.
05. Click the first **Enter text** field.
06. Set the message header to `skip-zivver-relay`.
07. Click Save.
08. Click the second **Enter text** field.
09. Set the value to `true`.
10. Click Save.
11. Click Next.

### Set rule settings

1. Leave the **Rule mode** on the default setting of **Enforce**.
2. Leave the **Severity** on the default setting of **Not specified**.
3. _Optional_: Enable **Activate this rule on** and select a date and time if you want this mail flow rule to be automatically activated.
4. Leave **Deactivate this rule on** disabled.
5. Leave **Stop processing more rules** disabled.
6. Leave **Defer the message if rule processing doesn’t complete** disabled.
7. Leave **Match sender address in message** to the default setting of **Header**.
8. Enter the comment `Exclude messages that have been processed and sent by the Zivver Platform to avoid mail looping.`.
9. Click Next.

### Review and finish

1. When you are satisfied that the mail flow rule is configured correctly, click Finish.
2. Click Done.

### Set the priority

1. Ensure the mail flow rule has a higher priority than the Secure Direct Replies rule we will create in the next chapter.

### Activate the rule

After the rule has been created and assigned the correct priority, it can be enabled.

### Repeat steps for X-Zivver-DLP header

If your organization also uses a Zivver client integration (such as Zivver for Outlook, or Zivver for Gmail), this additional exception is required for emails that have been scanned by a Zivver client integration and for which the user decided not to activate Zivver. These can be excluded from being routed through the Zivver Secure Direct Replies rule.

1. Repeat all steps above, substituting the following:
   - Enter `Zivver: Detect messages scanned by client integration` as the name of the rule.
   - Replace `X-Zivver-Transport` header with the `X-Zivver-DLP` header wherever it occurs.
   - Enter `Exclude messages that have already been scanned by a Zivver client integration to avoid DLP Gateway overruling user decisions or making a suggestion that was already provided while the message was composed.` as the comment.

## Secure Direct Replies rule

Now that the exemption rule is created, it is time to create the rule that will process the Secure Direct Reply messages. In this chapter we explain how to set up the Secure Direct Replies rule.

### Getting started

1. Login at the [Exchange admin center](https://admin.exchange.microsoft.com/#/homepage) with your admin account.
2. Open _mail\_outline_ **Mail flow**.
3. Click **Rules**.
4. Click _add_ **Add a rule**.
5. Click **Create a new rule**.
6. Enter `Zivver: Secure Direct Replies 2.0` as the **Name \***.

### Set mail flow rule conditions

01. Open the **Select one** dropdown menu under **Apply this rule if \***.
02. Select **The message headers…**.
03. Open the **Select one** dropdown menu next to it.
04. Select **matches these text patterns**.
05. Click **Enter text**.
06. Enter `References`.
07. Click Save.
08. Click **Enter words**.
09. Enter `zivver-sdr-<your_Zivver_UUID>`.

Tip

**Please fill in your Zivver UUID**

Please remove the placeholder `<your_Zivver_UUID>` from the current step and replace it with your Zivver organization UUID. You can find the UUID in the Zivver admin portal under **General** \> [**Organization account**](https://app.zivver.com/admin/organization-account) \> **Export user data** \> **User name**.

10. Click Add.
11. Click Save.

### Set mail flow rule actions

01. Open the **Select one** dropdown menu under **Do the following \***.
02. Select **Redirect the message to**.
03. Open the **Select one** dropdown menu next to it.
04. Select **the following connector**.

Tip

**Don’t have a connector for Zivver yet?**

Please read [this manual](https://docs.zivver.com/en/admin/smtp/create-a-connector-online.html) for instructions on how to create a connector in Exchange Online.

05. Select the Zivver connector.
06. Click Save.
07. Click on the _add_ icon next to **the following connector**.
08. Open the **Select one** dropdown menu under **And**.
09. Select **Modify the message properties**.
10. Open the **Select one** dropdown menu next to it.
11. Select **set a message header**.
12. Click the first **Enter text**.
13. Enter `zivver-relay`.
14. Click Save.
15. Click the second **Enter text**.
16. Enter
    - `sdr` → when using the Zivver Encryption Gateway.
    - `smart-sdr` → when using the Zivver DLP Gateway.
17. Click Save.

### Set mail flow rule exceptions

01. Open the **Select one** dropdown menu under **Except if**.
02. Select **The message headers…**.
03. Open the **Select one** dropdown menu next to it.
04. Select **matches these text patterns**.
05. Click **Enter text**.
06. Enter `skip-zivver-relay`.
07. Click Save.
08. Click **Enter words**.
09. Enter `true`.
10. Click Add.
11. Click Save.
12. Click Next.

### Set rule settings

1. Leave the **Rule mode** on **Enforce**.
2. Leave the **Severity** on **Not specified**.
3. Leave **Activate this rule on** unchecked.
4. Leave **Deactivate this rule on** unchecked.
5. Check **Stop processing more rules**.
6. Leave **Defer the message if rule processing doesn’t complete** unchecked.
7. Leave **Match sender address in message** on **Header**.
8. _Optional_: Enter a comment in the **Comments** section. E.g. the purpose of this rule (allow Zivver Secure Direct Replies on your mailserver).
9. Click Next.

### Review and finish

1. Review the settings of the rule.
2. Click Finish.
3. Click Done.

### Set the priority

1. Scroll down to your new rule.
2. Click on the rule.
3. Click _settings_ **Edit rule settings**.
4. Change the **Priority \*** so that this rule is placed immediately after the Exemption rule(s) created in the [previous chapter](https://docs.zivver.com/en/admin/smtp/create-sdr-rule-exchange-online.html#exemption-rule).
5. Click Save.
6. Click Done.
7. Click the rule again.
8. Enable the rule by clicking _toggle\_on_.

Updated on 2026-06-18
