# Create SDR rule in Exchange On Premise

## Introduction

This document explains how to configure mail flow rules for Secure Direct Replies in Exchange On Premise. 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. Go to the Exchange Administrative Center (EAC).
2. Log in to EAC as an administrator.
3. Click **Mail flow** in the menu on the left.
4. Click **Rules**.
5. Click the _add_ icon.
6. Click **Create a new rule...**.
7. Enter `Zivver: Detect processed messages` as the name.
8. At the bottom of the page, click **More options...**.

### Set mail flow rule conditions

1. Under **\*Apply this rule if...**, select **A message header...** > **matches these text patterns**.
2. Click **\*Enter text...**.
3. Set the message header to `X-Zivver-Transport`.
4. Click OK.
5. Click **\*Enter text patterns...**.
6. Enter the value `..*.` (2 dots, 1 asterisk/wildcard, 1 dot).
7. Click the _add_ icon.
8. Click OK.

### Set mail flow rule actions

1. Under **\*Do the following...**, select **Modify the message properties...** > **set a message header**.
2. Click the first **\*Enter text...** field.
3. Set the message header to `skip-zivver-relay`.
4. Click OK.
5. Click the second **\*Enter text...** field.
6. Enter `true`.
7. Click OK.

### Set rule settings

1. Leave **Audit this rule with severity level** on **Not specified**.
2. Leave **Choose a mode for this rule** on **Enforce**.
3. Optional: enable **Activate this rule on the following date** and select a date and time if you want this mail flow rule to be automatically activated at a specific time.
4. Leave **Deactivate this rule on the following date** 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:** on **Header**.
8. Enter the comment: `Exclude messages that have been processed and sent by the Zivver Platform to avoid mail looping.`.
9. When you are satisfied that the mail flow rule is configured correctly, click Save.

### Set the priority

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

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

If your organization uses a Zivver client integration (such as Zivver for Outlook or Zivver for Gmail), an additional exception is required for emails scanned by the integration where the user chose not to activate Zivver. These can be excluded from being routed through the Secure Direct Replies rule to avoid overruling user decisions.

1. Repeat all steps above, substituting the following:
   - Enter `Zivver: Detect messages scanned by client integration` as the rule name.
   - Replace the `X-Zivver-Transport` header with `X-Zivver-DLP` wherever applicable.
   - Use the following comment:
     `Exclude messages that have already been scanned by a Zivver client integration to avoid DLP Gateway overruling user decisions or repeating suggestions already shown during composition.`

## Secure Direct Replies rule

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

### Getting started

1. Go to the Exchange Administrative Center (EAC).
2. Log in to EAC as an administrator.
3. Click **Mail flow**.
4. Click **Rules**.
5. Click the _add_ icon.
6. Click **Create a new rule...**.
7. At the bottom of the window, click **More options...**.
8. Enter `Zivver: Secure Direct Replies 2.0` as the **Name**.

### Set mail flow rule conditions

1. Open the **Select one** dropdown under **\*Apply this rule if...**.
2. Select **A message header...** > **matches these text patterns**.
3. Click **\*Enter text...** and enter `References`.
4. Click OK.
5. Click **\*Enter text patterns...**.
6. Enter `zivver-sdr-<your_Zivver_UUID>`.

Tip

**Please fill in your Zivver UUID**

Remove the placeholder `<your_Zivver_UUID>` and replace it with your Zivver organization UUID. You can find the UUID in the Zivver admin portal under **General** > **Organization account** > **Export user data** > **User name**.

7. Click the _add_ icon.
8. Click OK.

### Set mail flow rule actions

1. Under **\*Do the following...**, select **Redirect the message to...** > **these recipients**.

Tip

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

Please read the following manuals:

1. [Create an accepted domain](https://docs.zivver.com/en/admin/smtp/create-an-accepted-domain-on-premise.html).
2. [Create a contact](https://docs.zivver.com/en/admin/smtp/create-a-contact-on-premise.html).
3. [Create a send connector](https://docs.zivver.com/en/admin/smtp/create-a-send-connector-on-premise.html).

02. Select the contact with the fictive domain.
03. Click add ->.
04. Click OK.
05. Click add action.
06. Open the **Select one** dropdown under **And**.
07. Select **Modify the message properties...** > **set a message header**.
08. Click the first **\*Enter text...**.
09. Enter `zivver-relay`.
10. Click OK.
11. Click the second **\*Enter text...**.
12. Enter:

- `sdr` → when using the Zivver Encryption Gateway.
    - `smart-sdr` → when using the Zivver DLP Gateway.

14. Click OK.

### Set mail flow rule exceptions

01. Click add exception under **Except if...**.
02. Open the **Select one** dropdown.
03. Select **A message header...** > **matches these text patterns**.
04. Click **\*Enter text...**.
05. Enter `X-Zivver-Transport`.
06. Click OK.
07. Click **\*Enter text patterns...**.
08. Enter `..*.` (2 dots, 1 asterisk/wildcard, 1 dot).
09. Click the _add_ icon.
10. Click OK.

### Set rule settings

1. Leave **Audit this rule with severity level** on **Not specified**.
2. Leave **Choose a mode for this rule** on **Enforce**.
3. Leave **Activate this rule on the following date** unchecked.
4. Leave **Deactivate this rule on the following date** 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. Optionally enter a comment explaining the purpose of this rule.
9. Click Save.

### Set the priority

1. Scroll down to your new rule.
2. Double-click the rule.
3. Change the **Priority** so that the rule is placed immediately after the exemption rule(s) created in the previous chapter.
4. Click Save.

Updated on 2026-02-24
