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

# Email Authentication

This article explains how xorlab verifies email senders and how you can view this information in the UI.

Authenticating senders is essential for email security. It helps to:

* Use trust relationships between sender and recipient for better classification
* Detect threats such as impersonation, BEC, and phishing

> [!TIP]
>
> **Header from vs. envelope from**
>
> xorlab treats the **header from** address as the sender, not the **envelope from**. An email is marked authentic (`#auth`) only if the header from is successfully authenticated.

## Understanding the information in the UI

Each email shows a summary of authentication checks in the **Authentication** box of the detail view. A checkmark next to the header from address indicates whether the email is considered authentic overall.

![Authentication of the sender](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/email-authentication-overview.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=8a4004aa7b37752e03a6ca4f7d9840bd)

**Legend**

* **Blue** — Check passed
* **Red** — Check failed and flagged as suspicious
* **Gray** — Check unavailable (e.g., missing SPF/DKIM) or failed but not considered suspicious

Each check contributes to the email authentication in the following way:

| Check | Description | Authentication Impact | Colors |
| - | - | - | - |
| **SPF** | Validates the envelope from domain using SPF. | Authenticates the sender **only when combined with a valid DMARC check**. | **Green** — SPF pass **Gray** — Neutral or no SPF **Red** — SPF fail or softfail |
| **DKIM** | Verifies all available DKIM signatures. | Authenticates the sender **only when combined with a valid DMARC check**. | **Green** — At least one valid signature **Gray** — No signature **Red** — All signatures invalid |
| **DMARC** | Checks SPF and DKIM alignment. | A passing DMARC check authenticates the sender (requires SPF or DKIM success). | **Green** — SPF aligned or DKIM aligned **Gray** — Both SPF and DKIM unavailable **Red** — All other cases |
| **Network** | Custom DNS checks (see details below). | A passing Network check authenticates the sender. | **Green** — At least one check passed **Gray** — No checks passed |

### SPF

SPF checks if the **envelope from** domain allows the sending server to send emails for it.\
On its own, SPF doesn’t stop attackers from faking the **header from** address (the one which is seen in the inbox).\
That’s why SPF only counts when it also passes **DMARC alignment** — meaning the envelope from and header from domains match. You can see both in the email detail view.

![Header from and envelope from](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/header-envelope-from.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=38830fbc0412441bd0a127b06bdca9dc)

### DKIM

DKIM makes sure the email hasn’t been changed on the way by checking its digital signatures.\
But an attacker could still create a fake email and sign it with their own DKIM key. That’s why DKIM only counts with **DMARC alignment** — the **signing domain** has to match the **header from** domain you see as the sender. You’ll find the signing domain in the `dkim-signature` header (`d=` value).

![Header from and envelope from](https://mintcdn.com/xorlab/O_O2TUa6eRBR54aI/9.0/assets/signing-domain.png?fit=max\&auto=format\&n=O_O2TUa6eRBR54aI\&q=85\&s=ff31abfcec1d851ca31c92897c7f5cf1)

### DMARC

DMARC ties everything together. It works only if at least SPF or DKIM is valid, and makes sure they match the visible sender.\
Specifically:

* With SPF, the envelope from and header from must match
* With DKIM, the signing domain and header from must match

> [!TIP]
>
> **Domain alignment**
>
> By default, xorlab uses **relaxed alignment**. That means the main domain has to match, but subdomains don’t need to.

### Network

The Network check consists of several individual checks. Passing any one of them is enough for the overall Network check to pass and to authenticate the sender.\
Results are either **pass** or **neutral** — there is no negative outcome.

| Check | Description |
| - | - |
| **DNS MX check** | Passes if the sending IP is listed in the MX records of the sender domain. |
| **DNS check** | Passes if (1) the EHLO domain matches the sender domain, and (2) its A record matches the sending IP. |
| **Reverse DNS check** | Passes if (1) the PTR record of the sending IP matches the sender domain, and (2) its A record points back to the same IP. |
| **Header from SPF check** | Passes if the SPF check succeeds for the header from domain. |
| **Private IP check** | Passes if the sending IP is a private address. |

> [!TIP]
>
> **Domain alignment**
>
> As with DMARC, xorlab only requires the **root domains** to match in these checks.

## Common situations

The table below lists typical issues with email authentication and how to handle them.

| Situation | Explanation | Measures |
| - | - | - |
| **Sender has valid SPF but is not marked authentic** | Usually, the envelope from domain (used for SPF) differs from the header from domain, which breaks DMARC alignment. | Ask the sender to use the same domain for both. If that’s not possible, configure a [Trusted MTA](https://docs.xorlab.com/9.0/trusted-mtas.md) in xorlab to override authentication. |
| **Email has a valid DKIM signature but is not marked authentic** | Usually, the DKIM signing domain is different from the header from domain, which breaks DMARC alignment. | Ask the sender to sign with the same domain as the header from. If that’s not possible, use a [Trusted MTA](https://docs.xorlab.com/9.0/trusted-mtas.md) configuration. |
| **SPF/DKIM failed, but the email was not blocked** | A failing SPF or DKIM alone is not enough to block an email, as this also happens with legitimate mail. However, it is still treated as a negative signal and increases the chance of blocking. | If you want to block all such emails, create a campaign based on the `#dkimfail` and `#spffail` tags. |
| **Email passes SPF/DKIM but is still blocked** | Authentication only proves that the email was actually sent from the sender domain, not that the email is safe. Attackers can still send from valid domains. | Create a campaign or add the sender to the Low trusted sender addresses list to make sure the email is not blocked. |

## Configuration options

We generally recommend leaving email authentication settings unchanged, as adjustments can reduce detection accuracy.\
However, the `active_guard.yml` file provides parameters to fine-tune authentication checks, which may be useful in some on-premise setups.

See the `authentication` block in [active\_guard.yml](https://docs.xorlab.com/9.0/active_guard_yml.md) for all available options.

For example, the configuration below optimizes Network checks so they run only if no other check passes.\
This reduces DNS requests but also limits the information shown in the UI.

```yaml theme={null}
pipelineTypeConfig:
  emails:
    authentication: 
      privateIpPolicy: UNLESS_AUTHENTICATED
      borderReverseDnsCheckPolicy: UNLESS_AUTHENTICATED
      borderDnsCheckPolicy: UNLESS_AUTHENTICATED
      borderMxCheckPolicy: UNLESS_AUTHENTICATED
```


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