Intercept mail traffic on Exchange Server and Office365

I've got a request to capture all email traffic on the Exchange server and store mail to the dms/database.

After some investigation, I came to the conclusion, that the best way to implement something like this would be a custom TransportAgent.

There are a few question marks around that:

  1. The MS documentation seems to be fairly outdated and the code examples seem to be gone. It mentions Exchange 2013 everywhere, the newer versions should support them too though.

  2. Office365 do not support them at all (as to the Office 365 is a long term plan, the problem will arise again later).

My question is, what is the best way to implement something like this? Are there any hooks or APIs that would allow me to intercept all incoming and outgoing mail (or just for a certain domain for example but not just per user account)?

And ideally, is there a solution that would be reusable for both on premises and in cloud Exchange server/Office365?


Solution 1:

And ideally, is there a solution that would be reusable for both on premises and in cloud Exchange server/Office365?

Yes. Journaling is available in both on premises Exchange Server and in Office 365.