Exchange 2010 Custom Transport Agent

This is a wrap-up of an older post initially published on my former website.

Even though this post focusses on Exchange 2010 transport agents, you will get an understand of what is required to create an Exchange 2013/2016, aka Version 15 transport agent.

Visual Studio Project

Writing your own transport agent for Exchange 2010 is not complicated. With a Visual Studio C# Class project, you are ready to go.

The following picture shows the Visual Studio Solution as it has been used for the Message Modifier Solution.

Visual Studio Solution

Besides the C# class the solution contains the following Powershell script to simplify development and deployment:

  • Add-TransportAgent.ps1
    Installs the transport agent on the productive Exchange Server
  • Remove-TransportAgent.ps1
    Uninstalls the transport agent on the productive Exchange Server
    See https://granikos.eu/remove-a-custom-exchange-2010-transport-agent/
  • Build-DeploymentPackage.ps1
    Copy all required DLLs, Powershell scripts, and the deployment configuration file to a dedicated folder
  • install.ps1
    Installs the transport agent on the development Exchange Server
  • uninstall.ps1
    Uninstalls the transport agent on the development Exchange Server

The transport agent intercepts a message from a given sender address and performs the following actions:

  • If the message has attachments with file names starting with “WORKBOOK_” the attachments are renamed to the following format:

    [yyyyMMdd] [EMAIL SUBJECT]-[NUMBER].[ORIGINAL EXTENSION]
     

  • The subject is rewritten from the format

    [dd.MM.yyyy] [SUBJECT TEXT]
    to
    [yyyyMMdd] [SUBJECT TEXT]

Links

Code Sample

Entdecke mehr von Granikos GmbH & Co. KG

Jetzt abonnieren, um weiterzulesen und auf das gesamte Archiv zuzugreifen.

Weiterlesen