# Exchange Recipient Checks: Setup

URL: https://email-validation.org/docs/guides/exchange/
Updated: 2026-12-04

> Documentation index: https://email-validation.org/llms.txt

A transport agent for **Exchange Server Subscription Edition (SE)** that checks the recipients outside your
organization of the mail your users send, while the message passes the Transport service of your Mailbox server. By
default it only logs each result. When a check cannot be made in time, the API answers with an error or the agent
cannot start, the message goes on unchanged. It never delays mail by more than a few seconds and never drops a
recipient silently.

**Exchange Online (Microsoft 365) cannot run transport agents**: Microsoft's documentation says "Transport agents are
not supported in Office 365 or Exchange Online". For mailboxes there, see [Exchange Online](#exchange-online).

Download the agent's sources, its PowerShell installer and its settings file as one zip:
[ev-exchange-1.0.0.zip](https://email-validation.org/downloads/exchange/ev-exchange-1.0.0.zip), which unpacks into a folder `ev-exchange/`. You
build it once against your own server's Exchange assemblies (Microsoft's files, which we cannot ship). It is under the
MIT licence (`LICENSE` in the zip): you may use, change and share it. It has not yet run on a production Exchange
server: try it on a test server first.

## What gets checked

The agent is a routing agent on the Transport service of a Mailbox server. When a message leaves the Submission
queue (Exchange's `OnSubmittedMessage` event), it checks the message only if its sender is inside your organization,
and then only the recipients that are not. Exchange's own address book decides what is inside, plus any domains you
list in `internal_domains`. Mail from outside, delivery reports and messages to your own users only are never
checked. At most `max_recipients` (50) recipients of one message are checked; the rest go out unchecked.

## Set it up

1. Create an API key for Exchange on the [API keys page](https://email-validation.org/app/api-keys/) with the permission **Validate addresses**
   and a [daily credit cap](https://email-validation.org/docs/authentication/#limits).
2. **Build the agent.** On a Windows machine with .NET 8 or later and its `dotnet` command, in the unpacked `ev-exchange` folder,
   copy Exchange's two assemblies from your server's installation into `agent\lib`, then build:

   ```powershell
   mkdir agent\lib
   copy "$env:ExchangeInstallPath\Public\Microsoft.Exchange.Data.Common.dll" agent\lib
   copy "$env:ExchangeInstallPath\Public\Microsoft.Exchange.Data.Transport.dll" agent\lib
   dotnet build agent\src\EmailValidation.Exchange.Agent -c Release
   ```

   (Run the `copy` lines on the Exchange server, or copy the two files over by hand.) The result is the one file
   Exchange loads, `EmailValidation.Exchange.Agent.dll`, under `agent\artifacts\bin\`.
3. **Install it** on every Mailbox server that should check mail: in the Exchange Management Shell, run as
   administrator, from the `ev-exchange` folder, run `.\install\Install-EvAgent.ps1` and paste the key at the prompt
   (it is not shown). The script copies the agent to `C:\Program Files\EmailValidation\Exchange`, keeps its settings
   and key in `C:\ProgramData\EmailValidation\Exchange` (readable only by SYSTEM, Administrators and the Transport
   service), runs `Install-TransportAgent` and `Enable-TransportAgent`, and restarts the Transport service.
4. **Check it**: `Get-TransportAgent "email-validation.org recipient check"` shows it enabled, and the first line of
   today's log in `C:\ProgramData\EmailValidation\Exchange\logs\` says it started (or why it did not).

[Test addresses](https://email-validation.org/docs/test-addresses/) on `sandbox.email-validation.org` return the result their name says, cost nothing and
contact no mail server. But a transport agent sees whole messages, so **never send a message to one** from a
production server: log mode lets it go out, and the bounce would hurt your server's sender reputation. Try the modes
on a test server.

Settings live in `C:\ProgramData\EmailValidation\Exchange\ev-agent.conf` (every setting is listed there at its
default); after a change, run `Restart-Service MSExchangeTransport`. To update the agent, build the new version and run
`Install-EvAgent.ps1` again.

## Modes

| Mode | Set | What happens |
|---|---|---|
| Log (default) | nothing | a log line per checked recipient (`ev-check sender=… rcpt=… status=invalid reason=no_mailbox action=remove source=api`) |
| Header | `header = yes` | as log, and an `X-EV-Recipient-Status` header with the statuses of the message's outside recipients, each once (for example `valid, invalid`; `unchecked` for one that could not be checked), for a mail flow rule of yours to act on |
| Return | `return_invalid = yes` | as log, and a recipient whose result is `invalid` with one of `return_reasons` (and `disposable` too with `return_disposable = yes`) is removed: Exchange sends the sender a non-delivery report naming it and the reason, and the other recipients still get the message |

Return mode is off by default, because no check is perfect. It never acts on a recipient that could not be checked,
nor on an `unknown` result, and it is never silent: each removal is in the log, and the sender gets Exchange's report
with the address (unless their mail client asked for no failure reports). The header
belongs to the whole message: every copy carries it, Bcc recipients included, so it tells each recipient the statuses
of the others (never an address). The agent removes any copy of that header a message arrived with, so only its own
reaches your rules.

## What it costs

Each check the agent sends costs at most 1 credit, as with any [validation request](https://email-validation.org/docs/api/validate/); `unknown`
results, errors, malformed addresses and test addresses are free. A check of an address checked before also costs 1
credit ([repeat checks](https://email-validation.org/docs/api/validate/#repeat-checks)), so the agent keeps its own cache, and an answer from it
costs nothing. Credits come in one-time [packs](https://email-validation.org/pricing/), as little as $0.15 per 1,000 with the
50,000,000-credit pack (smaller packs cost more per credit), and new accounts get 500 free credits (100 when you sign up with a free email provider such as Gmail, Outlook or Yahoo, another personal mailbox such as a paid one like Fastmail or one from your internet provider, or an address from a relay or alias service).

Five limits cap what it spends:

- **The cache**: each result is reused until its time is up (30 days for `valid` and `disposable`, 7 days for
  `invalid` and `catch_all`, 30 minutes for `unknown`). An `unknown` that only says our side could not finish the
  check is not kept.
- **Per sender**: 30 checks at once, then 120 an hour, for each sender. Past that, their recipients go out unchecked,
  so a hijacked mailbox spends at most that much of your credits before its checks stop.
- **Per message**: at most 50 recipients checked.
- **Per day**: at most 1,000 checks a day (UTC) for all senders together, kept across restarts; once it is used up,
  every recipient goes out unchecked until the next day.
- **The key's daily credit cap**, which the API enforces whatever happens on your server.

Every limit but the last can be changed in `ev-agent.conf`. Each Mailbox server keeps its own cache and daily count.

## Privacy

The agent sends each outside recipient's address, and nothing else of the message, in the body of a `POST` to
`https://api.email-validation.org` (or `https://api-eu.email-validation.org` with `region = eu`, see [EU data residency](https://email-validation.org/docs/eu-data-residency/)), never in a URL and to no other
host. Its cache holds a keyed hash of each address, in memory only. Its log names the recipient (or only its domain,
with `log_recipient = domain`) and the sender as a short hash, never the API key.

## When something fails

Every failure lets the message go unchanged, and the log line's reason says why: `pending` (the API had not answered
within 3 seconds: the check finishes in the background and is cached for the next message), `busy`, `sender_limit`,
`daily_cap`, `too_many`, `api_limit` (the API asked to slow down; the agent waits as long as `Retry-After` says),
`no_credits`, `key_refused`, `api_error`, `bad_response`, `timeout`, `network_error`, `bad_address`,
`internal_error` or `paused`. After an answer that later checks would get too, such as a refused key, no credits left
or no answer from the API, the agent stops calling the API for a while (reason `paused`) instead of slowing every
message. Settings it cannot use (a typo, a key file it cannot read) stop it from checking anything: its log says why,
and every message goes out unchecked. To switch it off at once, run
`Disable-TransportAgent "email-validation.org recipient check"` and `Restart-Service MSExchangeTransport`; to remove
it, `.\install\Uninstall-EvAgent.ps1` (with `-RemoveFiles` to delete its folders and the key file too).

## Exchange Online

Exchange Online does not run transport agents. What Microsoft documents instead, and how each meets this agent:

- **Hybrid, with centralized mail transport.** In an Exchange hybrid deployment, the Hybrid Configuration wizard's
  "Enable centralized mail transport" routes mail from Exchange Online mailboxes to the internet through your
  on-premises Exchange servers, where this agent can check it. Microsoft recommends it only for organizations with
  specific compliance needs ([Email routing in Exchange hybrid
  deployments](https://learn.microsoft.com/en-us/exchange/transport-routing)).
- **A mail flow rule and a connector.** An outbound connector from Office 365 to your organization's email server,
  used only when a mail flow rule redirects messages to it, and a rule "Redirect the message to the following
  connector" for the mail you choose, sends that mail through an on-premises Exchange server running this agent,
  which then relays it to the internet ([Scenario: Conditional mail routing in Exchange
  Online](https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/use-connectors-to-configure-mail-flow/conditional-mail-routing)).
- **While the message is written.** The [Outlook add-in](https://email-validation.org/docs/guides/outlook-add-in/) checks the recipients of a
  message in Outlook before it is sent; its guide says when you can install it.

Without an on-premises Exchange server in the path, nothing here checks Exchange Online's outgoing mail.

## Microsoft's documentation

- [Transport agents in Exchange Server](https://learn.microsoft.com/en-us/exchange/mail-flow/transport-agents/transport-agents)
- [Manage transport agents in Exchange Server](https://learn.microsoft.com/en-us/exchange/mail-flow/transport-agents/manage-transport-agents)
- [Transport agents in Exchange](https://learn.microsoft.com/en-us/exchange/client-developer/transport-agents/transport-agents-in-exchange-2013)
  (for developers: "Transport agents are not supported in Office 365 or Exchange Online")
- [Exchange Server supportability matrix](https://learn.microsoft.com/en-us/exchange/plan-and-deploy/supportability-matrix)
  (Exchange Server SE runs on .NET Framework 4.8 or 4.8.1; Exchange Server 2016 and 2019 left support on October 14, 2025)

## Related

- [Postfix](https://email-validation.org/docs/guides/postfix/)
- [Exim](https://email-validation.org/docs/guides/exim/)
- [Statuses and reasons](https://email-validation.org/docs/statuses/)
- [Rate limits](https://email-validation.org/docs/rate-limits/)

## More on Microsoft Exchange

- [Microsoft Exchange email validation integration](https://email-validation.org/integrations/exchange/)
