Question about Disclaimers on Exchange 2003 RRS feed

  • Question

  • I read plenty of topics and articles on that but I have a question that I didn't find any answer:

    Is it possible, into the vbs script, to add a filter to apply the disclaimer only on certain users ? (Member of a group for example)

    Here are our settings:

    - A front-End Exchange 2003 server in France

    - A back-End Exchange 2003 server in UK

    The external email from UK are sent by the Front-End server, never by the Back-end.

    Uk admins want to add a disclaimer only for us. In France, we don't want to.

    Here is an example of what I would like to do

    Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
    Set strGroup = "GroupName"
    Set strDomain = "DomainName"
    Set objNetwork = CreateObject("WScript.Network")
    Set strUser = Msg.From
    Dim found
    found = false
    On Error Resume Next
    ' Recherche l'utilisateur et ses informations
    Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser)
    If Err.Number = 0 Then
    For Each objGroup In objUser.Groups
    If StrComp(objGroup.Name, strGroup, 1) = 0 Then
    found = true
    Exit For
    End If
    End If
    ' If user is in group
    if found = True Then
    TextDisclaimer = vbCrLf & "DISCLAIMER:" & vbCrLf & "Sample Disclaimer added in a VBScript."
    HTMLDisclaimer = "<p></p><p>DISCLAIMER:<br>Sample Disclaimer added in a VBScript."
    If Msg.HTMLBody <> "" Then
     'Search for the "</body>" tag and insert our disclaimer before that tag.
     pos = InStr(1, Msg.HTMLBody, "</body>", vbTextCompare)
     szPartI = Left(Msg.HTMLBody, pos - 1)
     szPartII = Right(Msg.HTMLBody, Len(Msg.HTMLBody) - (pos - 1))
     Msg.HTMLBody = szPartI + HTMLDisclaimer + szPartII
    End If
    If Msg.TextBody <> "" Then
     Msg.TextBody = Msg.TextBody & vbCrLf & TextDisclaimer & vbCrLf
    End If
    'Commit the content changes to the transport ADO Stream object.
    Msg.DataSource.Save ' Commit the changes into the transport Stream
    EventStatus = cdoRunNextSink
    End If
    End Sub

    Is it possible ?

    Thursday, October 31, 2013 9:26 AM