Overview
In M-Files and in Microsoft world we have gotten used to the fact that admin has all rights to do anything and everywhere. When configuring Azure application for the external mail source, we must consent admin rights to it. See Chapter 4, Step 6 in the guide linked below.
This might be intimidating, because admin would have access to all mailboxes and in worst case scenario it would pull all mails from all people to M-Files with basically no access restrictions.
To mitigate the issue, you can limit the application's access to only a part of the Exchange Online mailboxes. The link for the Microsoft article is in Chapter 2's blue Tip.
Microsoft.com - Limiting application permissions to specific Exchange Online mailboxes.
Now, the interesting part is, whether those limitations effect on the admin consent? The answer is Yes: After setting the limitations, the application only retrieves the mails from the mailboxes that have been specified in the limitations.
Reference Documents
KB.cloudvault.m-files.com - Azure Portal Configuration for Microsoft Exchange Online as External Mail Source.pdf
Microsoft.com - Limiting application permissions to specific Exchange Online mailboxes.
