# How do Exchange Server's built-in anti-spam agents work, and are they enough?

URL: https://iblockspam.com/blog/exchange-server-anti-spam-agents
Last updated: 2026-10-10
Published: 2026-10-10
Topic: Setup guides
Author: iBlockSpam Team

> Exchange Server's built-in anti-spam agents: what each does, Mailbox vs Edge, installing with Install-AntiSpamAgents.ps1, their limits, and adding a hosted gateway.

## Short answer

Exchange Server 2016, 2019 and Subscription Edition include anti-spam transport agents: Sender Filter, Sender ID, Content Filter and Protocol Analysis on Mailbox servers, plus Connection Filtering, Recipient Filter and Attachment Filtering on Edge Transport. They aren't installed on Mailbox servers by default, and Microsoft stopped SmartScreen spam definition updates in 2016.

If you still run Exchange Server on-premises, your inbound spam protection is either the anti-spam agents built into Exchange, something in front of the server, or nothing at all. The built-in agents are free and documented, but Microsoft describes them as "relatively unchanged from Exchange Server 2010", and their content filter hasn't had new spam definitions since 2016.

This guide explains each agent, where it runs, how to install and tune it, where it falls short, and what to change when a hosted filtering gateway sits in front of the server.

## Which anti-spam agents does Exchange Server include?

Exchange provides anti-spam protection through transport agents, configured only in the Exchange Management Shell in Exchange 2016 and later ([Microsoft Learn](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/antispam-protection)). The same documentation applies to Exchange Server 2016, Exchange Server 2019 and Exchange Server Subscription Edition (SE).

| Agent | What it checks | Mailbox server | Edge Transport server |
|---|---|---|---|
| Connection Filtering | Connecting IP against IP block and allow lists and block list providers | Not available | Installed and enabled |
| Sender Filter | Envelope sender or domain against a blocked senders list | Via the install script | Installed and enabled |
| Recipient Filter | Recipient block list; rejects invalid recipients | Installed by the script, but don't configure it | Installed and enabled |
| Sender ID | The sending IP against the sender domain's SPF record | Via the install script | Installed and enabled |
| Content Filter | Message content; assigns a spam confidence level (SCL) from 0 to 9 | Via the install script | Installed and enabled |
| Protocol Analysis (sender reputation) | HELO/EHLO behavior, reverse DNS, past SCL scores and open proxy tests | Via the install script | Installed and enabled |
| Attachment Filtering | Attachment file name, extension or MIME type | Not available | Installed and enabled |

Separately, the Malware agent is installed and enabled by default on Mailbox servers ([Microsoft Learn](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/antispam-on-mailbox-servers)).

On a Mailbox server, Microsoft lists the order in which the agents act as Sender Filter, Sender ID, Content Filter, then Protocol Analysis. On an Edge server, Connection Filtering runs first and Attachment Filtering last.

### What each agent does in practice

- **Sender Filter** blocks known bad senders and domains early, before the message body is accepted.
- **Sender ID** evaluates the sender's SPF record against the connecting IP. Its default action on a Fail is to stamp the result rather than reject, and Outlook then uses that status when calculating the SCL ([Microsoft Learn](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/sender-id)).
- **Content Filter** assigns the SCL. You can add up to 800 custom Allow and Block phrases, which set the SCL to 0 or 9. Messages over 11 MB aren't scanned by its Intelligent Message Filter.
- **Protocol Analysis** calculates a sender reputation level (SRL) from 0 to 9 once a sender has sent 20 or more messages. At the default block threshold of 7, a sender is added to the block list, by default for 24 hours ([Microsoft Learn](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/sender-reputation)).

Microsoft's advice is to reject mail caught by connection, recipient and sender filtering outright rather than quarantine it, and to start the other agents at default settings before making them more aggressive.

## How do you install the anti-spam agents on a Mailbox server?

Microsoft says installing them matters "if these agents are your only defense to help prevent spam", and that you typically don't need them "when your organization uses other types of antispam filtering on incoming mail". If you have no Edge server and no other filtering, run these steps in the Exchange Management Shell on each Mailbox server that receives internet mail:

1. Run the install script:

   ```powershell
   & $env:ExchangeInstallPath\Scripts\Install-AntiSpamAgents.ps1
   ```

   The output lists the Content Filter, Sender Id, Sender Filter, Recipient Filter and Protocol Analysis agents.

2. Restart the transport service:

   ```powershell
   Restart-Service MSExchangeTransport
   ```

3. Tell the Sender ID agent which SMTP servers are internal. Microsoft says you must specify at least one; if this server is the only one, use its own IP address:

   ```powershell
   Set-TransportConfig -InternalSMTPServers @{Add="10.0.1.10","10.0.1.11"}
   ```

4. Confirm the agents are running:

   ```powershell
   Get-TransportAgent
   Get-ContentFilterConfig | Format-Table Name,Enabled
   ```

5. Check the anti-spam agent log location with `Get-TransportService | Format-List AgentLog*` and watch it for a few days.

Leave the Recipient Filter agent unconfigured on Mailbox servers. Microsoft warns that when it finds one invalid or blocked recipient in a message with other valid recipients, "the message is rejected."

## How should you tune the Content Filter?

The Content Filter acts on SCL thresholds, and the defaults are conservative ([Microsoft Learn](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/scl)):

| Threshold | Parameter | Enabled by default | Default value |
|---|---|---|---|
| Delete silently | `SCLDeleteThreshold` | No | 9 |
| Reject with NDR | `SCLRejectThreshold` | Yes | 7 |
| Quarantine to a spam mailbox | `SCLQuarantineThreshold` | No | 9 |
| Move to Junk Email | `SCLJunkThreshold` (organization) | Yes | 4 |

The Content Filter acts at "greater than or equal to" its thresholds, but the Junk Email threshold uses "greater than". With the default of 4, messages with an SCL of 5 or higher go to Junk Email.

A sensible first change is to enable the quarantine threshold just below the reject threshold, so borderline mail is held instead of delivered. Microsoft says the Quarantine action requires a spam quarantine mailbox, so create one first and make sure someone reviews it. Then run `Set-ContentFilterConfig -SCLQuarantineEnabled $true -SCLQuarantineThreshold 6` and check the result with `Get-ContentFilterConfig | Format-List SCL*`. Use the `Get-AntispamSCLHistogram.ps1` script in the Exchange `Scripts` folder to see how your scores are distributed before you tighten anything.

## What are the limits of the built-in agents?

The agents still do useful work, especially sender filtering and SPF checks. But plan around these limits:

- **No new spam definitions.** Microsoft says it "stopped producing spam definition updates for the SmartScreen filters in Exchange and Outlook" in November 2016, and that their effectiveness "will likely degrade over time" ([Microsoft Learn](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/content-filtering)). The same page still describes periodic content filter updates through Microsoft Update, so check what your servers actually receive.
- **SPF only, through Sender ID.** None of the agents is described as checking DKIM or enforcing a sender's DMARC policy. For context, see [SPF, DKIM and DMARC compared](https://iblockspam.com/blog/spf-vs-dkim-vs-dmarc).
- **No link or attachment detonation.** Attachment Filtering works on names, extensions and MIME types, and only on Edge. Nothing checks a URL at the moment of the click.
- **Attacks reach your server first.** Every spam connection uses your bandwidth, your server and your internet-facing port 25.
- **Management only in PowerShell**, with no quarantine portal for users. The spam quarantine is a mailbox an admin has to review.
- **Product lifecycle.** At the time of writing (October 2026), Microsoft's lifecycle pages show extended support for Exchange Server 2016 and 2019 ended in October 2025. A spam filter doesn't patch the server.

Microsoft's own anti-spam page points on-premises customers to its cloud filtering add-in for "more antispam features and easier management." Our comparison of [hosted vs on-premise spam filters](https://iblockspam.com/blog/hosted-vs-on-premise-spam-filter) covers the wider choice.

## How do you put a hosted gateway in front of Exchange Server?

With a hosted gateway, your MX points to the filtering service, which delivers clean mail to Exchange on port 25. The server-side work is to accept internet mail only from the gateway, and to stop the built-in agents from misjudging it. Our [Exchange Server platform guide](https://iblockspam.com/platforms/exchange-server) has the full procedure with commands and rollback; the outline is:

1. **Create a Receive connector scoped to the gateway's IP ranges.** On Mailbox servers, anonymous internet mail on port 25 arrives through the Front End Transport service (the **Default Frontend** connector), so create the gateway's connector there. When several connectors listen on the same port, Exchange uses the one whose remote IP range most specifically matches the connecting server ([Microsoft Learn](https://learn.microsoft.com/en-us/exchange/mail-flow/connectors/receive-connectors)). That lets the gateway have its own connector, with `-RemoteIPRanges` set to the gateway's ranges and the **AnonymousUsers** permission group, without touching **Default Frontend**.
2. **Don't use Externally secured with the Exchange servers permission group** for the gateway connector. That combination lets the listed IPs relay through your server.
3. **Review the anti-spam agents** (next section).
4. **Change the MX record** to the gateway and remove your server from MX completely. A backup MX pointing at Exchange gives spammers a route around the filter. See [changing MX records without losing email](https://iblockspam.com/blog/change-mx-records-without-losing-email) for timing.
5. **Restrict inbound port 25 at the firewall** to the gateway's ranges once the old TTL has expired. Removing your server from MX doesn't stop spammers who connect to its IP directly. Our guide to [blocking filter bypass](https://iblockspam.com/blog/block-direct-to-tenant-bypass) explains why this step matters.
6. **Test** by sending from an outside mailbox and checking the `Received` headers in the [Email Header Analyzer](https://iblockspam.com/tools/email-header-analyzer): the hop before Exchange should be the gateway.

### Which agents to change behind a gateway

Once every message arrives from the gateway, any agent that judges the connecting IP is judging the gateway, not the original sender:

| Agent | Behind a gateway | Recommendation |
|---|---|---|
| Sender ID | Compares the gateway's IP with the sender's SPF record, so legitimate mail can look like a failure | Disable: `Set-SenderIdConfig -Enabled $false` |
| Protocol Analysis | Builds reputation for the gateway's IPs from mixed traffic; a high SRL could block the gateway itself | Disable: `Set-SenderReputationConfig -Enabled $false` |
| Connection Filtering (Edge) | IP block list providers check the gateway's addresses, not the spammer's | Don't rely on it |
| Content Filter | Still scores content | Optional second layer at default thresholds |
| Sender Filter | Still matches the envelope sender | Fine to keep for specific blocks |
| Malware agent | Still scans attachments | Keep on |

Keep anything you leave enabled at default thresholds at first, so the two layers don't stack up false positives. If you run an Edge Transport server, apply the connector and agent changes on the Edge server instead, where internet mail enters.

A gateway also helps when the server itself is down. iBlockSpam, for example, holds mail for up to 5 days and delivers it when Exchange accepts connections again; see [what happens to email when your server is down](https://iblockspam.com/blog/what-happens-to-email-when-server-is-down).

## Next steps

1. Run `Get-TransportAgent` on each internet-facing server to see which agents are installed and enabled.
2. Check your current MX with the [MX Lookup](https://iblockspam.com/tools/mx-lookup) tool, and confirm your server has a matching [reverse DNS (PTR) record](https://iblockspam.com/blog/reverse-dns-ptr-records-for-mail-servers).
3. If the agents are your only filtering, install them, enable a reviewed quarantine mailbox, and watch the agent log.
4. If you're adding a hosted gateway, follow the [Exchange Server setup guide](https://iblockspam.com/platforms/exchange-server), then disable Sender ID and sender reputation.
5. Plan your next platform step while Exchange 2016 and 2019 are out of support.

Browse all [spam filter setup guides](https://iblockspam.com/blog/topic/setup).

## Frequently asked questions

### Does Exchange Server have a built-in spam filter?

Yes. Exchange Server 2016, 2019 and Subscription Edition include anti-spam transport agents, including a Content Filter that scores messages with a spam confidence level. On Mailbox servers they aren't installed by default; you add them with the Install-AntiSpamAgents.ps1 script. Edge Transport servers have them installed and enabled by default.

### Are Exchange Server's anti-spam definitions still updated?

Not the SmartScreen spam definitions. Microsoft says it stopped producing spam definition updates for the SmartScreen filters in Exchange and Outlook in November 2016, and that the existing definitions' effectiveness will likely degrade over time. The agents still work on sender lists, SPF, reputation and your own block phrases.

### Which anti-spam agents are only on Edge Transport servers?

The Connection Filtering agent and the Attachment Filtering agent are available only on Edge Transport servers. The Recipient Filter agent is installed on Mailbox servers by the script, but Microsoft says you shouldn't configure it there, because one invalid recipient causes the whole message to be rejected.

### Should I disable Exchange anti-spam agents if I use a hosted spam filter?

Microsoft says you typically don't need the agents on a Mailbox server when other anti-spam filtering handles incoming mail. If they're installed, disable Sender ID and sender reputation, because behind a gateway every message arrives from the gateway's IP addresses, so those checks judge the gateway rather than the original sender.

### What SCL does Exchange use to move mail to Junk Email?

The organization-wide SCLJunkThreshold defaults to 4, so messages with an SCL of 5 or higher go to Junk Email. The Content Filter's reject threshold is enabled by default at 7, while the delete and quarantine thresholds are disabled by default. You change them with Set-ContentFilterConfig and Set-OrganizationConfig.

## Sources

- [Microsoft Learn: Antispam protection in Exchange Server](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/antispam-protection)
- [Microsoft Learn: Enable antispam functionality on Mailbox servers](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/antispam-on-mailbox-servers)
- [Microsoft Learn: Content filtering](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/content-filtering)
- [Microsoft Learn: Exchange spam confidence level (SCL) thresholds](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/scl)
- [Microsoft Learn: Sender ID](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/sender-id)
- [Microsoft Learn: Sender reputation and the Protocol Analysis agent](https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/sender-reputation)
- [Microsoft Learn: Receive connectors](https://learn.microsoft.com/en-us/exchange/mail-flow/connectors/receive-connectors)

## Free tools for this guide

- [MX Lookup](https://iblockspam.com/tools/mx-lookup): See where your mail is delivered, spot unfiltered backup MX and broken hosts.
- [Email Header Analyzer](https://iblockspam.com/tools/email-header-analyzer): Trace hops and authentication results — runs entirely in your browser.
- [SPF Checker](https://iblockspam.com/tools/spf-checker): Count real DNS lookups, find PermErrors, loops and risky "all" settings.
- [Reverse DNS (PTR) Lookup](https://iblockspam.com/tools/ptr-lookup): Check PTR records, forward-confirmed reverse DNS and generic-looking host names.

---

Source: iBlockSpam, https://iblockspam.com/blog/exchange-server-anti-spam-agents (this is a Markdown copy; the HTML page is canonical). Quote with attribution and a link. Site index for AI assistants: https://iblockspam.com/llms.txt
