How to Record Long Term Statistics About Mail Flow Rule Reports

Azure Automation and Mail Flow Rules Reporting.

A question about an article describing how to use a mail flow rule to suppress inbound email from spammer domains led to a discussion about gathering statistics over a longer period than the ten days allowed by the Get-MailDetailTransportRuleReport cmdlet. The solution is a scheduled Azure Automation runbook to update a CSV file stored in SharePoint with weekly statistics. Over time, data accrues to support statistical analysis. The solution works, with some care taken with Graph SDK Files cmdlets.

Checking the Effectiveness of a Transport Rule to Block Spammy Email

Transport rule and spammy domains.

Some weeks ago, I wrote about using a transport rule to suppress spammy email by sending the messages to the quarantine. But what’s the best way to check the rule’s effect? One method is to use the transport rule report PowerShell cmdlet to check for the actions you expect the rule to perform. Once information is found, it’s a matter of slicing and dicing the data.