Skip to main content


Showing posts from September, 2007

Email and Attachment Archiving with a Transport Agent on Exchange 2007

I’ve been continuing on with building and learning about Transport Agents over the past couple of weeks and thought I’d share an agent I’ve found useful. The following agent is a simple archiving agent it saves the serialized version of the message from the Mimedocument class to an eml file in a directory assigning it a GUID as a filename to make sure its unique. It also enumerates though the attachments of a message and saves them to a separate directory using the attachment filename and the message guid to link the message and attachments. I also added some code into to delete pdf files that where smaller than 20 KB this was for testing purposes but it’s something I’ve used in the past in SMTP sinks to overcome certain issues. Like the last Agent I posted this is a Routing agent I’m running on Hub Server the code is relatively simple to follow. To do the attachment processing I’ve used the new EmailMessage class that’s part of the Microsoft.Exchange.Data.Transport.Email namespace.

Adding an X-header in an Exchange Routing Transport Agent in Exchange 2007

This week I’ve been looking at Transport Agents which are the replacement to Transport Event Sinks in Exchange 2007. After the initial struggle of finding some decent information to get going these Agents are surprising easy to code and have a bunch of powerful functions that are more readily available then they were when compared to SMTP transport Event Sinks. Getting Start info If you’re looking for info on getting start the first place is this simple sample . One piece of advice is before you look at installing a Transport Agent making sure you know how to disable or remove one first. There are two types of Transport Agents Routing and SMTP which one you use really depends where in the Transport Pipeline you want to intercept the message. I choose a Routing Transport agent because I wanted to be able to add an X-header to a message regardless of whether the message arrived via SMTP or if it was sent locally on a Mailbox server (if you are looking to do this in a SMTP Transpor
All sample scripts and source code is provided by for illustrative purposes only. All examples are untested in different environments and therefore, I cannot guarantee or imply reliability, serviceability, or function of these programs.

All code contained herein is provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.