Hello, @EnterpriseArchitect,
Welcome to the Microsoft Q&A platform!
To identify which public IP addresses are using your MX records or sending emails to your Exchange Online MX records, you can use the message trace feature in the Exchange admin center (Message trace in the new EAC in Exchange Online | Microsoft Learn). This will help you identify the IP addresses of the senders.
Then use an MX lookup tool to check your domain's MX records and see which mail servers are listed. This can help you verify if your MX records are correctly pointing to your anti-spam filter service. You can use tools like UptimeRobot's MX Lookup to check your MX records.
To lock down the email flow to only accept mail from your dedicated anti-spam filter service, you can create an inbound connector in Exchange Online. When configuring the connector, make sure to only accept mail from the IP addresses of your anti-spam filter service.
Then you can use PowerShell to create an inbound connector with IP restrictions, replace <IP1>,<IP2>,<IP3>
with the actual IP addresses of your anti-spam filter service.
New-InboundConnector -Name "Anti-Spam Filter" -RequireTls $true -ConnectorType Partner -SenderDomains * -RestrictDomainsToIPAddresses $true -SenderIpAddresses <IP1>,<IP2>,<IP3>
For reference, please visit How to configure Microsoft 365 to only accept mail from third-party spam filter - ALI TAJRAN.
(Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.)
Finally, enable Enhanced Filtering for Connectors (Enhanced filtering for connectors in Exchange Online | Microsoft Learn) to ensure that your anti-spam filter service is trusted and that legitimate emails are not misclassified.
By following these steps, you can effectively manage and protect your email flow. Should you need more help on this, you can feel free to post back.
If the answer is helpful, please click on “Accept answer” as it could help other members of the Microsoft Q&A community who have similar questions and are looking for solutions.
Thank you for your support and understanding.
Best Wishes,
Alex Zhang