1. Resources
  2. Detection rules
  3. Mail Flow Rule or Connector That Copies or Reroutes Mail

Mail Flow Rule or Connector That Copies or Reroutes Mail detection rules

With an Exchange admin role an attacker creates a mail flow (transport) rule that copies or redirects messages for the whole organization, or changes a connector so mail is accepted from or routed through a server they control.

Platform
Microsoft Exchange
Severity
High
Log source
Microsoft 365 unified audit log (Exchange)
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
An account or application with the Transport Rules role, or the Remote and Accepted Domains role for connectors, both of which Organization Management holds by default.
Impact
A copy of mail for the whole organization or for chosen senders and recipients, or silently rerouted mail, that survives every user's password reset.
Response
Export the rule or connector before you delete it, then contain the administrator account or application that made the change and block the destination for outbound mail.
Mitigation
Keep the role groups that hold the Transport Rules and Remote and Accepted Domains roles small, and review mail flow rules and connectors on a schedule.
Operations
New-InboundConnectorSet-InboundConnectorNew-OutboundConnectorSet-OutboundConnectorNew-TransportRuleSet-TransportRule

How the attack works

Mail flow rules, also called transport rules, act on messages in transit for the whole Exchange organization. A rule created with New-TransportRule or changed with Set-TransportRule can add a blind copy recipient (BlindCopyTo), add a copy recipient (CopyTo), add recipients (AddToRecipients) or redirect the message (RedirectMessageTo). One rule therefore reaches every mailbox, where an inbox rule reaches one. Connectors decide which servers Exchange Online accepts mail from and where it sends mail: New-InboundConnector, Set-InboundConnector, New-OutboundConnector and Set-OutboundConnector.

An attacker who holds a role with these cmdlets (the Transport Rules role, or the Remote and Accepted Domains role for connectors, both part of Organization Management) can copy the organization's mail to a mailbox they read, or route mail through infrastructure they control. Exchange Online writes each cmdlet to the Microsoft 365 unified audit log with its parameters.

What an attacker needs

  • An account or application with the Transport Rules role (Organization Management, Compliance Management and Records Management hold it by default) or, for connectors, the Remote and Accepted Domains role (Organization Management).

Impact

A copy of mail for the whole organization or for chosen senders and recipients, or mail that is silently rerouted. Because the rule is tenant configuration, it survives every user's password reset and is rarely reviewed.

Detection rules

Exchange Online Connector Created or Changed

Detects a new or changed inbound or outbound connector in Exchange Online. Connectors decide which servers the organization accepts mail from and where it routes mail, so a change can let an outside server send as the organization or reroute its mail. Connector changes are rare. Requires Microsoft 365 audit logging and the Exchange records of the unified audit log in the SIEM.

LevelMediumStatusExperimentalLog sourceMicrosoft 365 unified audit log (Exchange)
title: Exchange Online Connector Created or Changed
id: 676852ef-46c7-4d59-bbcd-4ed5893bf051
status: experimental
description: >-
  Detects a new or changed inbound or outbound connector in Exchange Online.
  Connectors decide which servers the organization accepts mail from and where
  it routes mail, so a change can let an outside server send as the
  organization or reroute its mail. Connector changes are rare. Requires
  Microsoft 365 audit logging and the Exchange records of the unified audit log
  in the SIEM.
references:
  - https://attack.mitre.org/techniques/T1114/003/
  - https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/new-inboundconnector
  - https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/set-outboundconnector
author: Forestall
date: 2026-11-11
tags:
  - attack.collection
  - attack.t1114.003
logsource:
  product: m365
  service: exchange
detection:
  selection:
    Operation:
      - New-InboundConnector
      - Set-InboundConnector
      - New-OutboundConnector
      - Set-OutboundConnector
  condition: selection
falsepositives:
  - Planned mail routing changes, a new mail gateway or filtering service, and runs of the Hybrid Configuration wizard, which manages the hybrid connectors. Match each event to a change request.
level: medium

False positives

  • Planned mail routing changes, a new mail gateway or filtering service, and runs of the Hybrid Configuration wizard, which manages the hybrid connectors. Match each event to a change request.

Mail Flow Rule That Copies or Redirects Messages

Detects a mail flow (transport) rule created or changed in Exchange Online with an action that sends messages to another recipient: BlindCopyTo, CopyTo, RedirectMessageTo or AddToRecipients. Such a rule applies to mail for the whole organization. Requires Microsoft 365 audit logging and the Exchange records of the unified audit log in the SIEM.

LevelHighStatusExperimentalLog sourceMicrosoft 365 unified audit log (Exchange)
title: Mail Flow Rule That Copies or Redirects Messages
id: e4e91d20-e5d4-485b-a8b3-1b2d0f0742f5
status: experimental
description: >-
  Detects a mail flow (transport) rule created or changed in Exchange Online
  with an action that sends messages to another recipient: BlindCopyTo, CopyTo,
  RedirectMessageTo or AddToRecipients. Such a rule applies to mail for the
  whole organization. Requires Microsoft 365 audit logging and the Exchange
  records of the unified audit log in the SIEM.
references:
  - https://attack.mitre.org/techniques/T1114/003/
  - https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/new-transportrule
author: Forestall
date: 2026-11-11
tags:
  - attack.collection
  - attack.t1114.003
logsource:
  product: m365
  service: exchange
detection:
  selection:
    Operation:
      - New-TransportRule
      - Set-TransportRule
    Parameters|contains:
      - BlindCopyTo
      - CopyTo
      - RedirectMessageTo
      - AddToRecipients
  condition: selection
falsepositives:
  - Journaling to a compliance mailbox, shared mailbox copies and migration rules created by administrators. Allow-list the approved destinations after reading them in Parameters.
level: high

False positives

  • Journaling to a compliance mailbox, shared mailbox copies and migration rules created by administrators. Allow-list the approved destinations after reading them in Parameters.

Triage

  • Read Parameters for the action and its destination (BlindCopyTo, CopyTo, RedirectMessageTo, AddToRecipients) and for the conditions that select messages. An external or unknown mailbox as destination is the signal.
  • For connectors, read the sender domains, IP addresses, smart hosts and certificate names in Parameters and compare them with your mail gateways.
  • Identify who made the change in UserId, whether a change request exists and whether that account showed risky sign-ins or a recent role change.
  • Disable an unexplained rule or connector first, then review message trace for what was copied or rerouted.

Response

Once the attack is confirmed:

  1. Export the rule or connector with all its conditions and destinations before you delete it. The destination and the message conditions show what the attacker was after.
  2. Contain the administrator account or application that made the change. Revoke its sessions, reset its credentials and remove it from the role groups that hold the Transport Rules and Remote and Accepted Domains roles.
  3. Check every other mail flow rule and connector, and forwarding on individual mailboxes, for the same destination address, domain, smart host or IP address.
  4. Block the destination address, domain or host for outbound mail where you can.
  5. List what was copied or rerouted, tell the affected senders and recipients, and replace what the copied mail exposed, such as password reset links, credentials and payment details.
  6. For a connector change, confirm with your mail gateway or provider that inbound and outbound mail again flows only through the servers you expect.

Mitigation

  • Keep the role groups that hold the Transport Rules and Remote and Accepted Domains roles small, and use just-in-time elevation for Exchange administration.
  • Review mail flow rules that copy, redirect or add recipients, and all connectors, on a schedule and after any admin account incident.
  • Set automatic external forwarding to Off in the outbound spam filter policies; note that this does not stop a mail flow rule.
  • Alert on every new or changed mail flow rule and connector in the unified audit log.

Frequently asked questions

Does turning off automatic external forwarding stop a mail flow rule?

No. That setting in the outbound spam filter policies is worth having, but it does not stop a mail flow rule. A mail flow rule acts on messages in transit for the whole organization and is tenant configuration, so it needs its own review and alerting.

How is this different from a forwarding rule in one mailbox?

An inbox rule reaches one mailbox and can be set by whoever controls that mailbox. A mail flow rule acts on messages in transit for the whole Exchange organization and needs an Exchange admin role. Because it is tenant configuration, it survives every user's password reset and is rarely reviewed.

Which mail flow rules does the detection not match?

The rule matches new or changed mail flow rules whose parameters include BlindCopyTo, CopyTo, RedirectMessageTo or AddToRecipients. A mail flow rule with another action is not matched. Changes to where mail is accepted from or routed to are covered by the separate rule on inbound and outbound connectors.

Why did the connector rule fire during hybrid setup?

The Hybrid Configuration wizard manages the hybrid connectors, so its runs create or change connectors and match the rule. Planned routing changes and a new mail gateway or filtering service do the same. Connector changes are rare, so match each event to a change request.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.