Mail Flow — Domains, Connectors, Rules & Message Trace
MS-203 Exam Alignment
MS-203
Skill Area 2 — Manage mail flow (the most heavily weighted MS-203 domain): configure accepted domains and remote domains, create and manage connectors, write transport rules, understand Exchange Online Protection filtering order, and trace messages end-to-end.
- Know the three accepted domain types cold — Authoritative vs Internal Relay vs External Relay
- Understand when a connector is required and when default mail flow (MX to EOP) is sufficient
- Know transport rule structure: conditions, exceptions, actions, priority order, and stop processing
- Understand SPF, DKIM, and DMARC at the level of what each record validates
- Know Message Trace retention: 10 days real-time, up to 90 days via extended trace reports
🗺️ How Mail Flows Through Exchange Online
💡 The Default Path — MX → EOP → Mailbox
In a standard Exchange Online tenant, your domain's MX record points to Exchange Online Protection (e.g. techcareers-in.mail.protection.outlook.com). Inbound mail arrives at EOP, passes connection filtering, anti-malware, anti-spam and anti-phishing checks, then transport rules run, and the message is delivered to the mailbox. Outbound mail leaves via EOP directly to the recipient's MX. No connectors are needed for this default flow — connectors exist only for special routing scenarios.
🌐 Accepted Domains
An accepted domain is any SMTP namespace for which your organisation sends or receives email. Every email domain added and verified in Microsoft 365 automatically appears here. The type controls what Exchange Online does with mail addressed to recipients it cannot find:
| Type | Behaviour for Unknown Recipients | When to Use |
|---|---|---|
| Authoritative | Reject with NDR 550 5.1.10 (recipient not found) — Exchange Online is the final destination | Default. All recipients for the domain exist in this tenant |
| Internal Relay | Relay onward via a connector to another email system (e.g. on-premises Exchange) | Hybrid coexistence, or a domain shared with another mail system |
| External Relay | Accept and relay to an external system that is fully authoritative for the domain | Rare — you accept mail for a domain hosted entirely elsewhere |
Connect-ExchangeOnline # List all accepted domains and their types Get-AcceptedDomain | Select-Object Name,DomainName,DomainType,Default # Change a domain to Internal Relay (hybrid coexistence) Set-AcceptedDomain -Identity "techcareers.in" -DomainType InternalRelay
🌍 Remote Domains
Remote domains control outbound message formatting and policy per destination domain — a frequently overlooked EAC page. The Default remote domain (*) applies to all destinations unless a more specific entry exists:
| Remote Domain Setting | Controls | Common Use |
|---|---|---|
| Out of Office types | Whether external OOF replies are sent to that domain | Suppress OOF to the internet, allow to partner domains |
| Automatic replies / forwards | Whether auto-replies and auto-forwards are allowed to the domain | Allow auto-forward only to an acquired company's domain |
| Delivery / read receipts (NDRs) | Whether delivery reports and NDRs flow to the domain | Suppress NDR backscatter to untrusted destinations |
| Message format | Rich text (TNEF) vs MIME, character sets | Fix "winmail.dat" attachment issues to a specific domain |
🔌 Connectors
Connectors define trusted routing paths beyond the default flow. Directionality is from the Exchange Online perspective:
| Connector | Direction | Typical Scenarios |
|---|---|---|
| Inbound connector | Partner org or your on-premises server → Exchange Online | Hybrid mail flow; third-party gateway (Mimecast/Proofpoint) delivering filtered mail; multifunction printers/apps relaying via your tenant; enforcing TLS from a partner |
| Outbound connector | Exchange Online → partner org, smart host, or on-premises | Routing all outbound mail through a security gateway; delivering to on-premises mailboxes in hybrid; forcing TLS + certificate validation to a partner domain |
EAC › Mail flow › Connectors › + Add a connector
Connect-ExchangeOnline # Inbound connector for a third-party security gateway (identified by IP) New-InboundConnector -Name "Inbound from Gateway" -ConnectorType Partner -SenderDomains * -SenderIPAddresses 203.0.113.10,203.0.113.11 -RequireTls $true # Outbound connector routing ALL outbound mail via the gateway smart host New-OutboundConnector -Name "Outbound via Gateway" -ConnectorType Partner -RecipientDomains * -SmartHosts "smtp.gateway-partner.com" -TlsSettings EncryptionOnly -UseMXRecord $false # Audit all connectors Get-InboundConnector | Format-List Name,Enabled,SenderIPAddresses,RequireTls,ConnectorType Get-OutboundConnector | Format-List Name,Enabled,SmartHosts,TlsSettings,RecipientDomains,UseMXRecord # Validate an outbound connector end-to-end Validate-OutboundConnector -Identity "Outbound via Gateway" -Recipients "test@partner.com"
📜 Transport Rules (Mail Flow Rules)
Transport rules inspect every message in transit and apply actions when conditions match. Rules are evaluated in priority order (0 = first), and a rule can stop processing of subsequent rules. Each rule is built from conditions, exceptions, and actions:
| Scenario | Condition | Action |
|---|---|---|
| Block external auto-forwarding | Message type is Auto-Forward AND recipient is outside the org | Reject with explanation |
| Outbound disclaimer | Sender is inside org AND recipient is outside org | Append HTML disclaimer |
| Encrypt sensitive mail | Message contains sensitive info types (credit card, Aadhaar, PAN) | Apply Office 365 Message Encryption |
| Bypass filtering for trusted relay | Sender IP is in a defined range | Set SCL to -1 |
| Prepend external tag | Sender is outside the organisation | Prepend "[External]" to subject |
| Route Finance mail via partner | Sender is a member of the Finance group | Use the specified outbound connector |
Connect-ExchangeOnline # 1. Block external auto-forwarding (security baseline) New-TransportRule -Name "Block External Auto-Forward" -MessageTypeMatches AutoForward -SentToScope NotInOrganization -RejectMessageReasonText "External auto-forwarding is not permitted. Contact IT." -Priority 0 # 2. Tag external mail in the subject New-TransportRule -Name "Tag External Mail" -FromScope NotInOrganization -PrependSubject "[External] " # 3. Outbound HTML disclaimer New-TransportRule -Name "Outbound Disclaimer" -FromScope InOrganization -SentToScope NotInOrganization -ApplyHtmlDisclaimerText "<p>This email and any attachments are confidential.</p>" -ApplyHtmlDisclaimerLocation Append -ApplyHtmlDisclaimerFallbackAction Wrap # Review all rules in priority order Get-TransportRule | Sort-Object Priority | Select-Object Priority,Name,State,Mode # Test a rule safely before enforcing Set-TransportRule -Identity "Tag External Mail" -Mode TestWithPolicyTips
⚠️ Rule Mode — Test Before You Enforce
Every transport rule supports three modes: Enforce (live), TestWithPolicyTips (show tips to senders, take no action), and TestWithoutPolicyTips (log matches only — visible in message trace). For any rule that rejects or redirects mail, run it in a test mode first and review message trace results before enforcing. A badly-scoped reject rule can bounce legitimate business mail organisation-wide within minutes.
🛡️ Email Authentication — SPF, DKIM, DMARC
Exchange Online Protection validates inbound mail using three DNS-based standards, and you must publish them for your own domain to protect outbound reputation:
| Standard | What It Validates | DNS Record |
|---|---|---|
| SPF | The sending server's IP is authorised to send for the domain | TXT: v=spf1 include:spf.protection.outlook.com -all |
| DKIM | Message integrity — a cryptographic signature matched against a public key in DNS | Two CNAMEs: selector1._domainkey and selector2._domainkey → onmicrosoft.com keys; enabled in Defender portal |
| DMARC | Alignment of SPF/DKIM with the From: header, and instructs receivers what to do on failure | TXT at _dmarc: v=DMARC1; p=quarantine; rua=mailto:dmarc@techcareers.in |
🔍 Message Trace
Message Trace, at Mail flow → Message trace, follows email through Exchange Online: whether it was received, rejected, deferred, delivered, quarantined, or acted on by a rule. Real-time trace data covers the last 10 days; older messages (up to 90 days) require a downloadable extended trace report.
Connect-ExchangeOnline # Trace by sender over the last 48 hours Get-MessageTraceV2 -SenderAddress amit@techcareers.in -StartDate (Get-Date).AddHours(-48) -EndDate (Get-Date) | Select-Object Received,SenderAddress,RecipientAddress,Subject,Status # Hop-by-hop detail for one message (use MessageTraceId from above) Get-MessageTraceDetailV2 -MessageTraceId <id> -RecipientAddress user@partner.com | Select-Object Date,Event,Detail # Find all FAILED messages today Get-MessageTraceV2 -StartDate (Get-Date).Date -EndDate (Get-Date) -Status Failed | Select-Object Received,SenderAddress,RecipientAddress,Subject
💡 Reading Trace Status Values
- Delivered — reached the mailbox or next hop successfully
- Failed — rejected or NDR'd; open detail to see which check or rule rejected it
- Quarantined — held by anti-spam/anti-phishing policy; release from the Defender portal quarantine page
- FilteredAsSpam — delivered to Junk Email per spam policy action
- Pending / Deferred — still being processed or retried; persistent deferrals usually indicate connector or destination issues
💡 Best Practices
- Never create connectors "just in case" — default MX-to-EOP flow needs none, and unnecessary connectors are a common cause of mail loops
- Keep inbound connector IP lists in change control — a gateway IP change without a connector update silently breaks inbound mail
- Give every transport rule a comment describing its business purpose and owner; audit rules quarterly
- Deploy the Block External Auto-Forward rule at Priority 0 in every tenant unless there is a documented business exception
- Run new reject/redirect rules in TestWithoutPolicyTips mode for at least a week and review trace hits before enforcing
- Publish SPF with -all (hard fail), enable DKIM for every sending domain, and move DMARC from p=none to p=quarantine once reports are clean
- Bookmark Message Trace — it answers "the email never arrived" tickets in minutes and is the first tool to open for any delivery complaint
🎓 Interview Q&A
Contoso is mid-migration: half its mailboxes are in Exchange Online, half remain on-premises. Internet senders' mail arrives at Exchange Online first. Mail to on-premises users bounces with "recipient not found". What should you change?
All outbound email must be routed through a third-party DLP gateway at smtp.gateway.com before reaching the internet. What should you create?
You must deploy a rule that rejects messages containing customer credit card numbers sent to external recipients — but leadership requires proof it won't block legitimate mail first. What is the correct approach?
A recipient's mail server rejects your organisation's email, citing DMARC failure. SPF passes for your domain. What is the most likely cause?
A compliance officer asks you to confirm whether a specific email was delivered 45 days ago. What should you do?