SOLVED

Exchange Online message rule syntax

Copper Contributor

Hi,

 

I want to block messages to our company that contain the following text pattern: Missed voicemail

I do NOT want to block mails only containing the word: voicemail

We don't use the English language, except for the word voicemail, in our mail communication and the text string above (Missed voicemail) is usually phishing which we get bombarded with. Therefor I create a new rule in:

Mail flow > Rules > The subject or body > Subject or body matches these text patterns > Missed voicemail. 

This creates the following:

cxzxccxz_0-1669629884156.png

Note the single quotes ' ' these are added by Microsoft which is fine since the rule is created as text pattern.

If I add single quotes myself the following is created:

cxzxccxz_1-1669630402365.png

Which creates an extra set of single quotes and doesn't seem right.

 

So far so good. It seems I don't have to add quotes. However when I created a rule without a text pattern (subject or body includes any of these words) quotes are ALSO added:

cxzxccxz_2-1669630830221.png

These makes me wonder if I should add quotes myself when creating a text pattern rule or not. It is imperative for us to use the correct syntax in this and other rules otherwise legitimate mail might get blocked too. For example: mail with Missed voicemail should be blocked but mail that contains the word voicemail should NOT be blocked.

 

So my question is: when creating a rule with text pattern, should I add quotes myself to only match that pattern? Or should I leave out the quotes?

 

 

 

 

 

2 Replies
best response confirmed by cxzxccxz (Copper Contributor)
Solution
What you are describing is just UI quirks, what matters is the actual rule syntax, which you can confirm via PowerShell. Each entry you enter will be threated as a phrase, not separate words. So if you add an entry for 'Missed voicemail', but not separate entries for 'missed' and 'voicemail', you should be fine.

@Vasil Michevok that clears it up than. Thanks for your reply and info.

1 best response

Accepted Solutions
best response confirmed by cxzxccxz (Copper Contributor)
Solution
What you are describing is just UI quirks, what matters is the actual rule syntax, which you can confirm via PowerShell. Each entry you enter will be threated as a phrase, not separate words. So if you add an entry for 'Missed voicemail', but not separate entries for 'missed' and 'voicemail', you should be fine.

View solution in original post