none
Exchange 2013 Transport Rule Regex not working

    Question

  • Trying to create a transport rule based upon a regex expresion that will count number of recipients so that we can take action if that recipient count is at a certain number or higher.  My idea was to look a the To header and create a regex expression that would match only if number of @ symbols was greater than a specified number.  This is the regex expression I have come up with set to 5 for testing.  It works per all the online regex testers, but when applied to transport rule it doesnt work.

    ^(?:[^@]*\@){5,}[^@]*

    So the match will occur if 5 or more @ symbols exists.  

    For the transport rule I chose:

    A message header matches these text patters:  'To' header matches ^(?:[^@]*\@){5,}[^@]*

    Then reject the message.

    It accepts the rule as valid and lets me save it, restart transport service, yet the rule does not work.  What am I missing?  Shouldnt this work?


    Rich

    Friday, September 15, 2017 5:43 PM

All replies