Transport-Rule in Exchange 2010 to prefix the Subject

Assume, you'd like to prepend the subject of an e-mail with a prefix, if the e-mail has been sent from the certain computer and if it has a certain sender name. In this case you can create a new transport rule with Powershell.

For example, the subject should be prepended by the phrase '[Alert]', if the From address contains 'my_sender@company.com' AND if the computer's name, which the email is sent from, is 'my_computer.company.com'. The powershell command below configures this:

New-TransportRule
-Name 'My_transport_rule' -Comments 'My comment'
-HeaderContainsMessageHeader 'Received' -HeaderContainsWords 'my_computer.company.com '
-FromAddressContainsWords 'my_sender@company.com' -PrependSubject "[Alert] "

After the command has been executed the rule is active. It acts in the whole Exchange organization and is not restricted to a single server.

Please note that the argument for the parameter -HeaderContainsWords must contain the name, which the email program on the sender computer actually uses. If the new rule doesn't work as expected, look into the internet headers of a test e-mail and note the computer name, which is in the line Received.

0 Kommentare :: Transport-Rule in Exchange 2010 to prefix the Subject

Post a Comment