Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Troubleshooting/Error resolution

"AccessDenied" Error When Creating a Microsoft Exchange Online Email Connection

Last updated on 9 December 2024

Admin
Microsoft Entra ID Authentication

Overview

When configuring a Microsoft Exchange Online external mail source in M-Files Admin, you may receive the following error after attempting to save/apply the configuration: 

image.png

Test connection failed.
Communicating with the mail server “outlook.office365.com" failed.
Selecting a mail folder failed.
Getting a list of mail folders failed. (Listing folders failed. One or more errors occurred. Code: ErrorAccessDenied
Message: Access is denied. Check credentials and try again.
 

This error will occur even after confirming the correct Tenant ID, Client ID, and Client Secret are in place. 

Solution

Given that this is an access issue, the likely culprit is the API Permission settings in Azure AD. Ensure that the API Permissions are set exactly as noted in section 5 of the configuration guide here: Azure Portal Configuration for Microsoft Exchange Online as External Mail Source (site.com)

Specifically, when adding the Microsoft Graph permission, you must add the Mail.ReadWrite permission as an Application permission, do NOT add it as a Delegated permission as this will cause the AccessDenied error. 

Still need help?

On this page