Mail Flow Rules Syntax

Copper Contributor

I have a large list of file extensions that I need to have blocked.  Is there a way for me to dump all of these file extensions in at once while creating the rule, or do I have to manually copy and past each one over?

4 Replies

hey Blake,

i hope the following link will help you solving your question!

https://docs.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/conditions-and-exc...

R,

Sameer

You can use the "common attachment types filter" functionality for Malware policies as detailed here: https://docs.microsoft.com/en-us/office365/SecurityCompliance/configure-anti-malware-policies

 

The corresponding PowerShell cmdlets allow you to bulk add/remove file types, including custom ones.

I am strictly speaking about the mail flow rules.  Is there a way to upload bulk words or phrases for the rules to look for?  I am trying to create a rule that rejects a message if the attachment extension contains "words or phrases" in it, and I have a 90+ extension list to upload for these words or phrases.  Is there a proper way of formatting when inputting these words or phrases?  I feel as though manually copying and pasting each one will result in missing some.

You can use the Set-TransportRule cmdlet, add the extensions to a list like the example below:

 

Set-TransportRule -AttachmentExtensionMatchesWords @('bbbb','aaaa')