16 luglio 2011

Exchange 2007: semplice esempio di regola di trasporto.

Ecco di seguito una semplice regola di trasporto per exchange 2007. Serve a porre un MARK sul subject di ogni mail che matcha su un certo dominio. Per esempio ho un exchange con un pop connector che scarica le mail da 2 differenti domini ma voglio che uno dei due venga individuato a colpo d'occhio dagli utenti, inserendo una specifica stringa sull'oggetto dell'email. Nel caso seguente inserisco la stringa PIPPO come prefisso dell'oggetto di tutte le email che hanno come destinatiri *@miodom.com Ecco la regola:

C:\> $condition = Get-TransportRulePredicate HeaderContains
C:\> $condition.MessageHeader = "To"
C:\> $condition.Words = @("miodom.com")
C:\> $action = Get-TransportRuleAction prependsubject
C:\> $Action.Prefix = "PIPPO "
C:\> New-TransportRule -name "MIODOM" -condition @($condition) -action @($Action) -enabled: $true

Name State Priority Comments
---- ----- -------- --------
MIODOM Enabled 1

C:\> Get-TransportRule | format-list

Priority : 1
Comments :
ManuallyModified : False
Conditions : {HeaderContains}
Exceptions :
Actions : {PrependSubject}
State : Enabled
Identity : MIODOM
Guid : 404acf8f-b9fd-463c-9127-f1c6717ced52
Name : MIODOM
IsValid : True
WhenChanged : 15/07/2011 16.50.10
ExchangeVersion : 0.1 (8.0.535.0)

A questo punto tutte le email dirette a @miodom.com avranno nel subject il prefisso "PIPPO ". A presto Lewis

Nessun commento:

Posta un commento