I need to code the following product (factory product, that can be used by any customer): A product that intercepts all emails being sent and received by Office 365 users in a company, the attachments of these emails should be modified.
So if peter@contoso.com sends an email to alan@othercompany.com and contoso.com is hosted using Office 365 then the attachments of that email will be transformed (both name and content). The same if alan sends an email to peter (incoming emails).
I was thinking in setting up connectors to route emails between Office 365 and another server, and that other server can be an Azure server (so all the data remains within MS cloud) and in the Azure server I can write a transport agent that will intercept all the emails. So each email will pass through the transport agent in the Azure server and that transport agent will process each attachment of each email.
Is it fully doable in this way?
Thanks