Exchange Server Share

May 17, 2008

Exchange 2007 – Transport Rules & Disclaimer

Filed under: Exchange,Exchange 2007,PowerShell — Amit Tank @ 6:30 pm

Exchange 2007 Transport Rules

Transport rule is a new feature of Exchange 2007.

Mail flow has changed in Exchange 2007 and all mails should pass through any of the Hub Transport server and this change made us to test all mails and apply some action based on conditions and exception  that is called transport rules.

When we create or modify transport rules, those are apply to all Hub Transport server in whole Exchange 2007 organization and replicated through Active Directory so those are consistence across the organization.

Transport Rules Creation Flow

The creation process contain three stages and you can select various values in each stage.

Conditions – > Actions -> Exceptions

List of Conditions are here….

From people
From a member of distribution list
From user inside or outside the organization
Sent to people
Sent to a member of distribution list
Set to user inside or outside organization
Between members of distribution list and distribution list
when any of the recipients in the To field is people
When any of the recipients in the To field is a member of distribution list
when any of the recipients in the Cc field is people
When any of the recipients in the Cc field is a member of distribution list
when any of the recipients in the To or Cc field is people
When any of the recipients in the To or Cc field is a member of distribution list
Marked with classification
When the subject field contains specific words
When the subject field or body of the message contains specific words
When a message header contains specific words
When the from address contains specific words
When the subject field contains text pattern
When the subject field or the body of the message contains text pattern
When the message header contains text pattern
When the from address contains text pattern
when any attachment file name contains text patterns
When a spam confidence level (SCL) rating that is greater than or equal to limit
When the size of any attachment is greater than or equal to limit
Mark with importance

Reference :

Transport Rule Predicates
http://technet.microsoft.com/en-us/library/aa995960.aspx

 

List of Actions are here….

Log an event with message
Prepped the subject with string
Apply message classification
Append disclaimer text using font,size,color, with separator and fallback to action if unable to apply
Set the spam confidence level to value
Set header with value
Remove header
Add a recipient in the To field addresses
Copy the message to addresses
Blind carbon copy (Bcc) the message to addresses
Redirect the message to addresses
Send bounce message to sender with enhanced status code
Silently drop the message

Reference :

Transport Rule Actions
http://technet.microsoft.com/en-us/library/aa998315(EXCHG.80).aspx

 

List of Exceptions are here….

Except when the message is from people
Except when the message is from members of distribution list
Except when the message is from users inside or outside the organization
Except when the message sent to people
Except when the message is sent to a member of distribution list
Except when the message is sent to users inside or outside the organization
Except when the message is sent between members of distribution list an distribution list
Except when any of the recipients is the To field is people
Except when any of the recipients in the To field is a member of distribution list
Except when any of the recipients in the Cc field is people
Except when any of the recipients in the Cc field is a member of distribution list
Except when any of the recipients in the To field or Cc field is people
Except when any of the recipients in the To field or Cc field is a member of distribution list
Except when the message is marked as classification
Except when the text specific words appears in the subject
Except when the text specific words appears in the subject or body of the message
Except when the text specific words appears in a message header
Except when the From address contains specific words
Except when the text pattern appears in the subject
Except when the text pattern appears in the subject or body of the message
Except when the text pattern appears in the header
Except when the From address contains text patterns
Except when the text pattern appears in any attachment file name
Except when the spam confidence level (SCL) that is greater than or equal to limit
Except when the size of the any attachment is greater than or equal to limit
Except when the message is marked as importance

Now Let’s create a test Transport Rule with an example. we are creating a disclaimer with it.

 

Configure a Disclaimer with Transport Rules.

 

Exchange Management Console

Open Exchange Management Console -> Organization Configuration -> Hub Transport -> click Transport Rules

Click on New Transport Rules

image

You can see the Introduction window.

Give Transport Rule Name and Comment & click Next. ( Enable Rules is selected by default)

image

You can see the Conditions window.

In Step 1 Select a condition(s) select sent to users inside or outside the organization

image

In Step 2 Edit the rule description by clicking an underlined value click on Inside and select Outside.

Click Next.

image

You can see the Actions window.

In Step 1 Select a action(s) select append disclaimer text using font, size, color, with separator and fallback to wrap if unable to apply.

 

image

In Step 2 Edit the rule description by clicking an underlined value click on disclaimer text and write your disclaimer. You may select your required font, font size, color and separators whatever you required & click OK.

image

Click Next.

image

You can see the Exceptions window.

In Step 1 Select a exception(s) if necessary you can select if you want to set any exception.

In Step 2 Edit the rule description by clicking an underlined value you can select the values for exceptions.

Click Next.

image

You can see the Create Rule window.

You can verify the configuration which you set while creating it so if something wrong then you may go back and correct it.

Click New, which will create a rule.

image

You can see the Completion window.

Click Finish.image

You can see the created transport rule.

image

With Exchange Management Shell

Run below command in Exchange shell to configure disclaimer rule which we configured through GUI.

=================== Code ===================

$Condition = Get-TransportRulePredicate FromScope
$Condition.Scope = “NotInOrganization”
$Action = Get-TransportRuleAction ApplyDisclaimer
$Action.Text = “Disclaimer: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.”
$Action.Font = “Arial”
$Action.FontSize = “Smallest”
$Action.FontColor = “Gray”
New-TransportRule -Name “Disclaimer: Outside Mails” -Condition @($Condition) -Action @($Action)

=================== Code ===================

References:

How to Configure a Disclaimer

http://technet.microsoft.com/en-us/library/aa996585(EXCHG.80).aspx

Understanding How Transport Rules Are Applied in an Exchange 2007 Organization

http://technet.microsoft.com/en-us/library/bb124703(EXCHG.80).aspx

 

About these ads

6 Comments

  1. [...] Reference: Exchange 2007 – Transport Rules & Disclaimer [...]

    Pingback by Exchange 2007 - Message Size Limits « Exchange Server Share — May 31, 2008 @ 4:31 pm

  2. Briliant article ..lots of information :) on transport rules

    Comment by Prabhu — June 7, 2008 @ 10:35 pm

  3. Excellent article that lead me to the following question –

    Would it be possible to rewrite the subject – with setheader – with the sender’s email address? I don’t see a way to copy the address to a temp variable and write it to the subject value….is there any way to do that?

    Comment by Michael — July 17, 2008 @ 7:58 pm

  4. Hello Michael,

    Nop, it is not possible to add sender’s address into subject line, actually built in transport rules don’t add any dynamic values.

    But here is a great article from MS Exchange Team to add DL name into subject line which is a custom transport rule, if you are looking for it.

    http://msexchangeteam.com/archive/2008/06/25/449079.aspx

    Comment by Amit Tank — July 20, 2008 @ 11:33 pm

  5. Hi! Great article!
    I am trying to figure out something here.
    I need to make to types of dislaimers.
    One disclaimer in Norwegian when insiders send mails to outsiders with .NO in the domain name.
    And one in english for all other domains. This last one i understand, but is it possible to make a transport rule to take action when an insider sends a mail to an outsider with .NO in the address field and append the norwegian version instead of the english one??

    Comment by Kenneth — September 26, 2008 @ 6:15 pm

  6. Is it possible to have a rule that looks in the header of an e-mail received for the MX Domain and if the MX Domain is a certain one then it sends an e-mail back saying the e-mail address will be changing?

    John.

    Comment by John Brines — October 7, 2008 @ 12:37 pm


RSS feed for comments on this post.

The Rubric Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 29 other followers

%d bloggers like this: