locked
Transport Rule Subject Field Contains RRS feed

  • Question

  • Hi,

    Can anyone share the filter whether just filter exact match, or each word match that define in the subject field contains? e.g. "Get Money", do the rule filter get money exactly in the subject? or "Get", "Money" also will get filter?

    What if "Why get money?", is this will get filter also? 

    Wednesday, December 12, 2012 1:58 AM

Answers

  • As I understand it, whatever is in the string is matched verbatim, so "Get Money" will match only that string with the two words in that order separated by one space.  If you want to fire the rule when both "Get" and "Money" are in the subject, then you could create two separate conditions for the two words.  For example:

    $Condition1 = Get-TransportRulePredicate SubjectContains
    $Condition1.Words = @("Get")
    $Condition2 = Get-TransportRulePredicate SubjectContains
    $Condition2.Words = @("Money")
    New-TransportRule -Name "Get Money" -Condition @($Condition1, $Condition2) ...

    If I'm wrong, I hope somebody will correct me.  I believe you can also use regular expressions, which might give you some more flexibility, but they can also be very hard to craft.

    The Exchange 2010 syntax for this sort of thing is much more logical.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    Wednesday, December 12, 2012 6:13 AM

All replies

  • What version, service pack and update rollup level of Exchange are you asking about?

    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    Wednesday, December 12, 2012 2:29 AM
  • Exchange 2007 SP1
    Wednesday, December 12, 2012 4:40 AM
  • As I understand it, whatever is in the string is matched verbatim, so "Get Money" will match only that string with the two words in that order separated by one space.  If you want to fire the rule when both "Get" and "Money" are in the subject, then you could create two separate conditions for the two words.  For example:

    $Condition1 = Get-TransportRulePredicate SubjectContains
    $Condition1.Words = @("Get")
    $Condition2 = Get-TransportRulePredicate SubjectContains
    $Condition2.Words = @("Money")
    New-TransportRule -Name "Get Money" -Condition @($Condition1, $Condition2) ...

    If I'm wrong, I hope somebody will correct me.  I believe you can also use regular expressions, which might give you some more flexibility, but they can also be very hard to craft.

    The Exchange 2010 syntax for this sort of thing is much more logical.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    Wednesday, December 12, 2012 6:13 AM