Transport Agent: Rewriting Sender or Recipient Domain No ratings yet.

Lately I’ve been working on few Transport Agents which I feel maybe handy to share.

While the logic adopted is very simple, the sample showcase how to inspect and modify entries in the P1 and P2 headers.


The requirement was for 2 separate agents one rewriting the sender domain and one rewriting the recipient domain.

The Project contains 2 Solutions; the way these agents works is the following.



If the email is sent TO <somerepicpient> then rewrite the recipient to <somerepicpient>



If the email is sent FROM <somesender> then rewrite the sender as <somesender>


Attached you can find the Visual Studio Project; this includes the Exchange 2013 Microsoft.Exchange.Data.Common and Microsoft.Exchange.Data.Transport DLL’s.

The sample though, can be easily adapted to Exchange 2010 if necessary. To do so all that needs to be done consists in removing the 2 DLL’s from the References (for each Solution), remove the files from .\<Solution>\Exchange, grab the same DLL’s from C:\Program Files\Microsoft\Exchange Server\V14\Public and re-add them to the References (for each Solution).



Please rate this


Leave a Reply

Your email address will not be published. Required fields are marked *