'Any Office 365 REST API(Graph API) to block delivery of certain emails - if its spam

I am exploring an option to see if it's possible to get messages scanned for all mailboxes in an organization (i.e within a domain) and block delivery of certain emails if its spam using Office 365 Mail REST APIs or if there is any other way to easily get these messages.

  • I have looked into connector, but that needs to setup own exchange server in windows platform, and its ruled out. Hence looking at Graph api.
  • Secondly, I looked at developing an email gateway, but for that MX records need to be updated and its not possible.

I have stuck with my analysis from last couple of weeks. Any pointers would help a lot. Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source