# Connecting MX Guarddog with LDAP

MX Guarddog only accepts email for addresses it knows about. With **LDAP Sync**, MX Guarddog reads your list of email addresses straight from ID Everywhere and keeps it up to date. Add someone in ID Everywhere and they start receiving mail (as long as they are configured on your email server); disable them and MX Guarddog stops accepting mail for them, without anyone editing MX Guarddog by hand.

<p class="callout info">MX Guarddog uses LDAP here only to read email addresses. Nobody signs in to MX Guarddog with their ID Everywhere password.</p>

## Before you start

- LDAP must be turned on for your company in ID Everywhere. See [Enabling LDAP for Your Organization](https://help.ideverywhere.com/books/ldap-integration/page/enabling-ldap-for-your-organization).
- You need to be a Domain Admin in ID Everywhere and able to edit your domain in the MX Guarddog Domain Center.
- Every address that should receive mail needs to be in ID Everywhere, as a user's email or one of their aliases. See [Check your addresses first](#bkmrk-2.-check-your-addres).

## 1. Get your LDAP details from ID Everywhere

1. In ID Everywhere, open **Settings** from your name menu and scroll to the LDAP section.
2. Under **LDAP Connection Details**, note the **Server**, the port shown next to **Connection** (normally `636`), and the **User Search Base**.
3. Under **Read-only LDAP Service Account**, note the **Bind DN**. Click **Reveal** next to **Service Account Password** and verify with two-factor authentication, then click **Copy**.

<p class="callout warning">The service account password gives read access to your company's directory. Paste it straight into MX Guarddog and don't send it by email.</p>

## 2. Check your addresses first

Once LDAP Sync is running, MX Guarddog accepts mail only for the addresses it imports, plus any you add yourself. Before you turn it on, make sure every address that receives mail is covered:

- **People:** each person's email address in ID Everywhere matches their mailbox.
- **Aliases:** extra addresses for a person, such as `jsmith@` as well as `john.smith@`, are added as **email aliases** on their user in ID Everywhere.
- **Shared mailboxes and lists,** such as `info@`, `billing@` or `support@`, either have a user in ID Everywhere or are kept in MX Guarddog's **Email Addresses** tab.

<p class="callout warning">Mail sent to an address MX Guarddog doesn't know about is rejected, unless you have a **Catch-All** email account setup in MX Guarddog. This is not enabled by default in MX Guarddog. Check the **Email Addresses** tab after the first sync (step 4) before you rely on it.</p>

## 3. Set up LDAP Sync in MX Guarddog

1. Sign in to MX Guarddog, open your domain, and go to the **LDAP Sync** tab (next to **Email Addresses**, **Catch-All** and **cPanel Sync**).
2. Fill in the fields:

<table id="bkmrk-mx-guarddog-field-va"><thead><tr><th>MX Guarddog field</th><th>Value</th></tr></thead><tbody><tr><td>LDAP Server</td><td>The **Server** from ID Everywhere (the host name only, without `ldaps://`)</td></tr><tr><td>Port</td><td>The port shown next to **Connection** in ID Everywhere, normally `636`</td></tr><tr><td>Username</td><td>The full **Bind DN** of the Read-only LDAP Service Account</td></tr><tr><td>Password</td><td>The **Service Account Password**</td></tr><tr><td>Server Type</td><td>**OpenLDAP**. If that doesn't import any addresses, try **Other**.</td></tr><tr><td>Base DN</td><td>The **User Search Base** from ID Everywhere</td></tr><tr><td>Use SSL</td><td>**Require SSL**. ID Everywhere's LDAP connection is LDAPS (encrypted with TLS).</td></tr><tr><td>Sync Frequency</td><td>**Every Hour** (recommended), so new and removed people are picked up quickly</td></tr></tbody></table>

3. Click **Save Configuration**.

## 4. Check the first sync

1. After the first sync runs, open the **Email Addresses** tab.
2. Confirm every active person in ID Everywhere is listed with the right email address.
3. Check that their **aliases** came through too. If they didn't, add the aliases in the **Email Addresses** tab yourself.
4. Make sure shared addresses like `info@` are still listed.
5. Send a test email to a synced address and to a shared address, and confirm both arrive.

## How addresses stay in sync

<table id="bkmrk-in-id-everywhere-in-"><thead><tr><th>In ID Everywhere</th><th>In MX Guarddog after the next sync</th></tr></thead><tbody><tr><td>New user added</td><td>Their email address is added</td></tr><tr><td>Email address or alias changed</td><td>The address list is updated</td></tr><tr><td>User disabled or deleted</td><td>Their address is removed, so MX Guarddog stops accepting mail for them</td></tr></tbody></table>

With **Every Hour**, changes reach MX Guarddog within about an hour.

<p class="callout info">Disabling a user is a common step when someone leaves. Their address then stops receiving mail at MX Guarddog. To keep receiving their mail, add their address as an alias on another user before disabling them, or add it in MX Guarddog's **Email Addresses** tab.</p>

## Troubleshooting

<table id="bkmrk-problem-cause-and-fi"><thead><tr><th>Problem</th><th>Cause and fix</th></tr></thead><tbody><tr><td>MX Guarddog can't connect</td><td>Check **Port** is `636`, **Use SSL** is **Require SSL**, and **LDAP Server** has the host name only.</td></tr><tr><td>Connects, but the sign-in to the directory fails</td><td>**Username** must be the full Bind DN, not just the account name. Copy the password again from ID Everywhere. If someone clicked **Regenerate Password**, update it in MX Guarddog too.</td></tr><tr><td>No addresses imported</td><td>Check **Base DN** is the **User Search Base** exactly. Then try **Server Type** **Other**.</td></tr><tr><td>Some people are missing</td><td>Only **active** users are in the directory. Check they're active in ID Everywhere and have an email address.</td></tr><tr><td>Aliases are missing</td><td>Add them in MX Guarddog's **Email Addresses** tab.</td></tr><tr><td>Mail to a shared address is rejected</td><td>Add the address in MX Guarddog's **Email Addresses** tab, or as an alias on a user in ID Everywhere.</td></tr></tbody></table>

For connection errors, see [Troubleshooting LDAP Sign-In](https://help.ideverywhere.com/books/ldap-integration/page/troubleshooting-ldap-sign-in).

## Related articles

- [Enabling LDAP for Your Organization](https://help.ideverywhere.com/books/ldap-integration/page/enabling-ldap-for-your-organization)
- [Connecting an Application to LDAP](https://help.ideverywhere.com/books/ldap-integration/page/connecting-an-application-to-ldap)
- [Troubleshooting LDAP Sign-In](https://help.ideverywhere.com/books/ldap-integration/page/troubleshooting-ldap-sign-in)