Exchange ServerHow-to

DLP and encryption gateways for Exchange Server (Forcepoint, Trellix): routing and loops

A vendor-neutral design for sending Exchange Server mail through DLP and encryption gateways: forward vs return patterns, connectors, verdict headers, fail-open choices and tests.

Inline DLP and encryption products such as Forcepoint DLP, Trellix DLP Network Prevent and email encryption gateways ask the same of Exchange Server: send outbound mail to them, then let them pass it on or hand it back. Get the hand-off wrong and you get loops, mail that quietly skips the scanner, or queues that fill when the appliance is down. This vendor-neutral guide covers patterns, connectors and tests.

Errors this guide fixes

  • 554 5.4.6 Hop count exceeded - possible mail loopNDR+4 more guides
  • 441 4.4.1 Error encountered while communicating with primary target IP addressQueue Viewer / Get-Queue LastError+4 more guides
How this guide is organised: How it works → Step-by-step → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. Step-by-step (6 steps: Choose the pattern; Build the connector to the gateway; Accept the return traffic (separate tier only); Act on verdict headers; Decide fail-open or fail-closed; Add TLS). 3. Verify. 4. Tips and gotchas. Toolbox: Deployment › System Modules, MaxMessageSize, ALLOW, ENCRYPT, SCANFAIL.1How it works2Step-by-step3Verify4Tips and gotchas1Choose thepattern2Build theconnector to…3Accept thereturn traffic…4Act on verdictheaders5Decidefail-open or f…6Add TLSTOOLBOXDeployment › System ModulesMaxMessageSizeALLOWENCRYPTSCANFAILHow this guide is organised: How it works → Step-by-step → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. Step-by-step (6 steps: Choose the pattern; Build the connector to the gateway; Accept the return traffic (separate tier only); Act on verdict headers; Decide fail-open or fail-closed; Add TLS). 3. Verify. 4. Tips and gotchas. Toolbox: Deployment › System Modules, MaxMessageSize, ALLOW, ENCRYPT, SCANFAIL.1How it works2Step-by-step1Choose the pattern2Build the connector to the gateway3Accept the return traffic (separate tier only)4Act on verdict headers5Decide fail-open or fail-closed6Add TLS3Verify4Tips and gotchasTOOLBOXDeployment › System ModulesMaxMessageSizeALLOWENCRYPTSCANFAIL
At a glance: how this guide is organised · 6 steps · 5 key settings and tools

How it works#

How Exchange picks a route#

For an external recipient, Exchange drops connectors whose size limit is smaller than the message, keeps those that are enabled, in scope for the local Active Directory site and matching the recipient's address space, takes the most specific address space, and then prefers the lowest aggregate cost (site link costs plus the address space cost, 1 to 100). Remaining ties go to the source server reachable in the fewest hops (the local server first), then to the connector whose name sorts first. Four consequences:

  • Routing never looks at how a message arrived, and Exchange Server's mail flow rules have no action that picks a send connector. A gateway that hands mail back to the servers that sent it creates a loop ending in 554 5.4.6 Hop count exceeded - possible mail loop.
  • Connectors with more specific address spaces (hybrid, partner, archive) bypass a * connector to the gateway.
  • A message larger than the gateway connector's MaxMessageSize can leave, uninspected, through another enabled * connector.
  • Mail flow rules can act on message headers, which is how verdict headers work.

How the products hand mail on#

  • Forcepoint DLP: the protector can act as an MTA. In the Data Security module of the Forcepoint Security Manager (Settings › Deployment › System Modules), you set the protector's SMTP service mode to Mail Transfer Agent (MTA), choose Monitoring or Blocking, and set the next hop MTA (smart host), the maximum message size (33 MB by default) and the networks allowed to send through it. The next hop must allow the protector to relay.
  • Trellix DLP Network Prevent (formerly McAfee DLP Prevent) delivers scanned mail to a configured smart host with an X-RCIS-Action header (ALLOW when nothing matched), and the smart host carries out the action. If that smart host is the same Exchange tier that sent the message, you have the loop pattern.
  • Symantec Network Prevent for Email has forwarding and reflecting modes; see Symantec DLP with Exchange.

Step-by-step#

1. Choose the pattern#

PatternMail pathWith Exchange
ForwardExchange › gateway › outbound gateway, hosted service or internetBest fit: no return trip into Exchange
Return to a separate tierMailbox servers in site A › gateway › relay servers in site B › internetWorks with scoped connectors per site; more servers to run
Return to the sending serversExchange › gateway › same Exchange serversLoops: Exchange can't tell scanned mail from new mail

A scoped connector (-IsScopedConnector $true) is only a candidate for servers in its own Active Directory site, which stops the site B relay servers routing back to the gateway. Nothing else should submit mail to them.

2. Build the connector to the gateway#

PowerShell
New-SendConnector -Name "Outbound via DLP gateway" -Usage Custom -AddressSpaces "SMTP:*;1" `
  -SmartHosts dlpgw1.contoso.com,dlpgw2.contoso.com -DNSRoutingEnabled $false `
  -SmartHostAuthMechanism None -SourceTransportServers EX01,EX02 -MaxMessageSize 30MB
Get-SendConnector | Format-Table Name,AddressSpaces,SmartHosts,MaxMessageSize,IsScopedConnector,Enabled -AutoSize

Set MaxMessageSize no higher than the gateway accepts, and disable other * connectors these servers could use, so oversized mail fails visibly instead of leaving uninspected. For the separate-tier design, add -IsScopedConnector $true here and create a scoped internet connector sourced on the site B servers.

3. Accept the return traffic (separate tier only)#

PowerShell
New-ReceiveConnector -Name "From DLP gateway" -Server RELAY01 -TransportRole FrontendTransport -Usage Custom `
  -Bindings 0.0.0.0:25 -RemoteIPRanges 10.0.5.21,10.0.5.22 -AuthMechanism ExternalAuthoritative -PermissionGroups ExchangeServers

This "Externally Secured" connector treats the gateway as a trusted internal source, so limit RemoteIPRanges to the gateway's addresses; that more specific match also wins over the default connectors.

4. Act on verdict headers#

Where the product reports its verdict in a header, mail flow rules on the servers receiving scanned mail act on it. Trellix's values are ALLOW, BLOCK, QUART, ENCRYPT, BOUNCE, REDIR, NOTIFY, BYPASS and SCANFAIL (a message that couldn't be analyzed); when several rules match, the highest-priority value wins. Two example rules, plus one that strips the header from inbound internet mail: Trellix replaces an existing X-RCIS header on mail it scans, but Exchange's header firewall doesn't remove vendor X-headers, so a sender could plant a verdict on mail that never passes the scanner:

PowerShell
New-TransportRule -Name "DLP verdict BLOCK" -FromScope InOrganization `
  -HeaderMatchesMessageHeader "X-RCIS-Action" -HeaderMatchesPatterns "BLOCK" `
  -RejectMessageReasonText "Blocked by the data loss prevention policy" -RejectMessageEnhancedStatusCode "5.7.1"
New-TransportRule -Name "DLP verdict QUART" -FromScope InOrganization `
  -HeaderMatchesMessageHeader "X-RCIS-Action" -HeaderMatchesPatterns "QUART" -RedirectMessageTo dlp-review@contoso.com
New-TransportRule -Name "Strip X-RCIS-Action from external mail" -FromScope NotInOrganization -RemoveHeader "X-RCIS-Action"

For ENCRYPT, Exchange can apply a rights management template with -ApplyRightsProtectionTemplate, which needs IRM (see IRM with the RMS connector), or tag the message for a downstream encryption gateway.

5. Decide fail-open or fail-closed#

  • Gateway side: Forcepoint asks what to do when an unspecified error stops analysis, Permit traffic or Block traffic. Trellix marks such messages SCANFAIL and leaves the decision to your rules.
  • Exchange side: when no smart host answers, the queue goes to Retry with 441 4.4.1 Error encountered while communicating with primary target IP address, and messages wait until they expire (two days by default): fail-closed. List at least two gateway nodes as smart hosts. For a manual fail-open, keep a disabled bypass connector and swap it in, knowing that mail sent meanwhile isn't inspected.
  • Timeouts: if sessions drop while large attachments are scanned, the send protocol log shows which side closed the connection (see SMTP protocol logging); compare that with the gateway's timeouts.

6. Add TLS#

PowerShell
Set-SendConnector "Outbound via DLP gateway" -RequireTLS $true -TlsAuthLevel CertificateValidation

The gateway's certificate must chain to a CA your Exchange servers trust, and the gateway must trust its own next hop.

Verify#

PowerShell
Get-TransportService | Get-MessageTrackingLog -Recipients test@fabrikam.com -Start (Get-Date).AddHours(-1) -ResultSize Unlimited |
  Sort-Object Timestamp | Format-Table Timestamp,ServerHostname,EventId,Source,ConnectorId -AutoSize
  • Forward design: one SEND through Outbound via DLP gateway per message. Separate tier: that SEND, one RECEIVE on From DLP gateway and one SEND through the site B connector. Repeating RECEIVE and SEND pairs mean a loop.
  • Send one message just under the size limit and one just over: the first is scanned, the second must not leave through another connector.
  • Check the external copy's headers for the product's verdict or pass header.
  • With one gateway node stopped, the queue shouldn't go to Retry.

Tips and gotchas#

References#

Revision history: Oct 2026 — re-checked against Microsoft Learn and the vendors' documentation: 3 details reworded or labelled as reported by admins.

Written and checked against current Microsoft Learn documentation and the vendor documentation linked in the references. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)