Deliver Sophos Phish Threat safely in Microsoft 365
Sophos Phish Threat provides two technically distinct delivery routes in Microsoft 365:
- M365 Direct Delivery uses Microsoft Graph to write campaign, training enrollment, and training reminder emails directly to mailboxes. The messages bypass the Microsoft transport pipeline, so Advanced Delivery does not apply.
- With SMTP delivery, the message passes through the Microsoft transport pipeline. Microsoft 365 must identify it as a third-party phishing simulation using the actual Sending IP and the domain from
5321.MailFromor the DKIM domain.
Both routes must be kept separate from Sophos Email Mailflow and Sophos Email Gateway. Phish Threat simulates attacks; Sophos Email protects production mail traffic. Direct Delivery requires neither MX records nor Exchange Online connectors. The SMTP route likewise does not justify a global EOP bypass or a blanket IP allow list.
Prerequisites and change boundaries
Before making the change, you need:
- an active Sophos Phish Threat license and an email domain verified in Sophos Fusion (formerly Sophos Central);
- administrative access to Sophos Phish Threat > Settings;
- an approved Microsoft Graph application and tenant-wide admin consent for Direct Delivery;
- permission to manage Advanced Delivery in the Microsoft Defender Portal for the SMTP route;
- one controlled pilot mailbox, a business owner, a change window, and an abort criterion for each domain.
For manual Direct Delivery setup, Sophos requires the Microsoft Graph application permissions (Application permissions, not delegated permissions) Domain.Read.All and Mail.ReadWrite; both require admin consent. Domain.Read.All can read all domain properties without a signed-in user. Without further restrictions, Mail.ReadWrite can read, create, modify, and delete messages in all mailboxes in the tenant. The permission does not include Mail.Send, but its tenant-wide read and write access still makes it highly privileged. This scope must be considered before consent is granted and during offboarding.
Record the domain, tenant ID, selected delivery route, credential, current Direct Delivery status, and existing Microsoft simulation values beforehand. An existing Sophos Email Mailflow or Gateway deployment remains a separate system. Do not change its connectors, transport rules, MX, SPF, or Enhanced Filtering settings as a side effect of this Phish Threat change. The relevant owner runbooks are Sophos Email Mailflow for Microsoft 365 and Sophos Email Gateway with Microsoft 365.
Select the delivery route
| Criterion | M365 Direct Delivery | SMTP with Advanced Delivery |
|---|---|---|
| Transport | Microsoft Graph writes directly to the recipient’s mailbox | Phish Threat sends via SMTP through the Microsoft transport pipeline |
| Microsoft configuration | Graph credential and tenant-wide consent | Third-party simulation under Advanced Delivery |
| Matching | No Advanced Delivery values | At least one actual Sending IP plus a 5321.MailFrom or DKIM domain |
| Safe Links | Advanced Delivery does not apply; a narrowly scoped exception may be required if a click block is reproduced | Correctly identified email simulation links are allowed automatically; do not add another URL exception |
| Rollback | Domain-specific deactivation and credential offboarding in the owner runbook | Restore the simulation configuration to the recorded initial state |
Sophos recommends Direct Delivery. It is enabled separately for each verified domain; a green status for one domain does not prove that other domains are ready. The owner runbook Sophos Phish Threat: Set up Direct Delivery covers authorization, quick testing, troubleshooting, and deactivation for this route. The rest of this article addresses the Microsoft 365-specific SMTP route and distinguishes it from Direct Delivery.
Set up SMTP delivery with Advanced Delivery
Do not copy variable Sophos values from an old guide. Immediately before the change, read them in Sophos Fusion under My Products > Phish Threat > Settings > Sending domains and IPs, then confirm them against the headers of a current pilot message. Allow-list Phish Threat senders and destinations covers other destinations and how to limit them safely.
Determine the correct matching values
Microsoft requires at least:
- the actual Sending IP that Microsoft 365 detects for the SMTP message; and
- either the domain from
5321.MailFrom— also called MAIL FROM, P1 sender, or Envelope Sender — or the provider-specified DKIM domain (header.d).
The visible From:/5322.From domain is not an interchangeable substitute. Therefore, check smtp.mailfrom, header.d, and the detected source IP in Authentication-Results. Microsoft does not pair individual domain and IP entries; keep both lists restricted to the Sophos values that are actually required.
The optional Simulation URLs to allow field is not required for links in email phishing simulations. Microsoft primarily intends it for non-email simulations, such as links in Teams messages or Office documents. Leave it empty for this email procedure.
Configure the Microsoft Defender Portal
- In the Microsoft 365 Admin Center, open Show all > Security.
- In the Microsoft Defender Portal, open Email & collaboration > Policies & rules > Threat policies.
- Under Rules, select Advanced Delivery.
- Open the Phishing simulation tab and select Edit. If no third-party simulation exists yet, the button for adding one appears instead.
- Under Domain, enter only confirmed
5321.MailFromor DKIM domains — not the visibleFrom:domain unless it is also one of those two values. - Under Sending IP, enter only the Sophos source IP detected by Microsoft or the verified, smallest possible range.
- Leave Simulation URLs to allow empty for this email simulation, compare the values with the change record, and select Save.
Connector and routing boundary
If the MX record does not point directly to Microsoft 365, the IP in Authentication-Results must still match the Sending IP configured under Advanced Delivery. Enhanced Filtering for Connectors can help detect the original source IP in supported upstream filtering topologies, but it replaces neither domain-and-IP matching nor the simulation configuration.
Microsoft explicitly documents a limitation for in-and-out routing through Internet > Microsoft 365 > on-premises environment or third-party security service > back to Microsoft 365: Microsoft 365 cannot reliably detect the true source IP of the third-party simulation, and Enhanced Filtering does not resolve this case. Do not enter the gateway, on-premises, or connector IP as the supposed Sending IP. Otherwise, any internet sender imitating a configured domain could bypass the spam filter.
The safe boundary is to send the simulation directly to the Microsoft 365 MX or use a method explicitly documented by Microsoft for the specific topology. If the real Sophos IP cannot be detected, stop the SMTP rollout instead of forcing it with a gateway IP or broad transport rule.
Classify Safe Links and Safe Attachments correctly
Do not mix the two delivery routes here:
- SMTP with a correct Advanced Delivery match: Safe Links does not block or detonate the specified URLs in this email simulation when clicked, and Safe Attachments does not detonate its attachments. The URLs remain rewritten. An additional entry under Do not rewrite the following URLs in email is unnecessary and may trigger unwanted click alerts.
- Direct Delivery: These messages bypass the transport pipeline, so Advanced Delivery does not apply. If a controlled Direct Delivery test reproduces a Safe Links click block, the Sophos-documented Safe Links exception, limited to the simulation domain actually used, may be required. It applies only to this Direct Delivery case and is implemented according to Allow-list Phish Threat senders and destinations.
Legacy transport rules using X-MS-Exchange-Organization-SkipSafeLinksProcessing or X-MS-Exchange-Organization-SkipSafeAttachmentProcessing are not an additional standard step. Evaluate an existing rule separately only when there is documented need and a confirmed narrow source-IP condition; never extend it to all messages or to an arbitrarily chosen sender domain.
Validation before the first SMTP campaign
Send a small pilot campaign only to authorized test accounts. For each domain, record the recipient, sending time, campaign ID, and expected matching values. Then verify:
- delivery or quarantine and the corresponding Microsoft Message Trace;
- the Sending IP detected by Microsoft and
smtp.mailfromandheader.din the message headers; - that at least the actual Sending IP and an eligible
5321.MailFromor DKIM domain match Advanced Delivery > Phishing simulation; - rendering, link clicks, and the expected Phish Threat events;
- that no automated check was counted as a user action.
The business evaluation belongs in Sophos Phish Threat: Results and reports. A Message Trace entry alone proves neither inbox delivery nor correct campaign measurement.
Troubleshoot systematically
| Symptom | Check | Safe action |
|---|---|---|
| SMTP mail is treated as High confidence phish | Compare the detected Sending IP and smtp.mailfrom or header.d with Advanced Delivery | Correct only the confirmed values; do not substitute 5322.From or use a global EOP bypass |
| Microsoft detects only a gateway IP | MX and connector path, Authentication-Results, in-and-out routing | Send directly to the Microsoft 365 MX or use a documented Microsoft method; do not allow the gateway IP |
| SMTP mail arrives, but the link is still blocked | First verify the complete domain-and-IP match and message recognition | Correct the Advanced Delivery configuration; do not add a Safe Links URL exception for an email simulation |
| Direct Delivery link is blocked | Confirm Direct Delivery and the Safe Links event | Consider only the narrowly scoped exception documented for Direct Delivery in the owner/allow-listing procedure |
| Clicks appear without user action | Advanced Delivery match and existing legacy rules | Do not count scanner access as a user response; remove broad or duplicate exceptions |
| SMTP mail is completely missing | Message Trace, quarantine, recipient, sending time, and header values | Correct one factor and repeat the same limited test |
If a test fails despite correct values, collect the domain, UTC time, recipient, campaign ID, Microsoft trace, relevant headers, and configured simulation values. Send this information to Sophos Support or the Microsoft 365 owner. Do not put secrets, access tokens, or unnecessary personal campaign data in the ticket.
Roll back and review SMTP exceptions
If an SMTP change fails, restore the previously recorded values under Advanced Delivery > Phishing simulation. Remove newly created exceptions or legacy transport rules only when their association with the affected simulation is unambiguous. Then use a controlled test to confirm that production mail flow still works unchanged. Sophos Email connectors and rules remain untouched.
At least before each new campaign series and after changes to the domain, Sophos sender values, routing, or Microsoft security policies, the owner checks:
- current Sophos values against the actual Sending IP and
smtp.mailfromorheader.dof a pilot message; - the direct or explicitly supported route to the Microsoft 365 transport pipeline;
- domains, IP addresses, and legacy rules that are no longer used;
- a controlled end-to-end test including a link click and campaign event.
When Sophos sender values change, replace them through an approved change and delete the old values only after successful pilot delivery. Direct Delivery credentials, testing, and offboarding remain in the Direct Delivery owner runbook, so the API lifecycle is maintained in only one place.