Search code examples
emailexchange-serverrules

Can I use NOT or 'only if' in Exchange message rules?


With the phishing test tool we use it's very labour intensive to ensure the test mails don't include a specific sender address. That's usually fine, but some of our inboxes are used to report security issues and are therefore monitored 24/7. It's annoying for the standby operator to start to work because of an out of office reply to a test phishing mail. So, I want to create a message rule in our Exchange admin portal to ensure automatic replies to phishing tests sent from a monitored address don't end up in the inbox of the monitored address and trigger our monitoring.

On the following page: https://admin.exchange.microsoft.com/#/transportrules I can create a rule that triggers when the e-mail is NOT an out of office reply:

Apply this rule if
The recipient is (monitored address)

Do the following
Reject the message with the explanation 'Block out of office replies to monitored addresses.' 

Except if
The message type is 'OOF' 

I'd like to change this to "The message type is NOT 'OOF'." or to use 'only if' instead of 'except if', but I can't find those options. ChatGPT says there should be some kind of 'more options' button, but I don't see that option so I think it made that up. Does anyone have an idea of how to achieve this?


Solution

  • Never mind, found that you can add additional (AND) conditions under 'apply this rule if' to achieve the desired goal:

    Apply this rule if
    
    Is sent to (monitored address)
    and Is message type 'Automatic reply'
    
    Do the following
    reject the message and include the explanation 'Block out of office replies to monitored addresses.'