Integrations · Mail servers and panels
Check outgoing recipients in Microsoft Exchange
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.
Download the agent's sources, its PowerShell installer and its settings file as one zip: 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
Create an API key for Exchange on the API keys page with the permission Validate addresses and a daily credit cap.
Build the agent. On a Windows machine with .NET 8 or later and its
dotnetcommand, in the unpackedev-exchangefolder, copy Exchange's two assemblies from your server's installation intoagent\lib, then build: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
copylines on the Exchange server, or copy the two files over by hand.) The result is the one file Exchange loads,EmailValidation.Exchange.Agent.dll, underagent\artifacts\bin\.Install it on every Mailbox server that should check mail: in the Exchange Management Shell, run as administrator, from the
ev-exchangefolder, run.\install\Install-EvAgent.ps1and paste the key at the prompt (it is not shown). The script copies the agent toC:\Program Files\EmailValidation\Exchange, keeps its settings and key inC:\ProgramData\EmailValidation\Exchange(readable only by SYSTEM, Administrators and the Transport service), runsInstall-TransportAgentandEnable-TransportAgent, and restarts the Transport service.Check it:
Get-TransportAgent "email-validation.org recipient check"shows it enabled, and the first line of today's log inC:\ProgramData\EmailValidation\Exchange\logs\says it started (or why it did not).
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; unknown results, errors, malformed addresses and test addresses are free. A check of an address checked before also costs 1 credit (repeat checks), so the agent keeps its own cache, and an answer from it costs nothing. Credits come in one-time packs, 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
validanddisposable, 7 days forinvalidandcatch_all, 30 minutes forunknown). Anunknownthat 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), 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).
- 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).
- While the message is written. The 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
- Manage transport agents in Exchange Server
- Transport agents in Exchange (for developers: "Transport agents are not supported in Office 365 or Exchange Online")
- Exchange Server 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)