The outlook.office.com IMAP/SMTP with OAuth integration is based on a legacy model with limited and gradually restricted support. Microsoft recommends migrating to the Microsoft Graph API for improved reliability, security, and long-term compatibility. Continued use of IMAP/SMTP OAuth may result in reduced functionality or service disruptions in future updates.
Use the following example to configure Office 365. Open a private or incognito browser window first, as explained in the OAuth2 section.
Registering the application
To begin configuration, the user must register the application. To do this, go to ‘https://portal.azure.com/’
and then log in to your account. When the login process is successful, select ‘App registrations’ from the
left menu. When the window opens click on ‘New registration’.
In order to configure your application correctly, you must first enter an application name. Then in the
‘Supported account types’ section select ‘Accounts in any organizational directory (Any Azure AD directory - Multitenant)
and personal Microsoft accounts (e.g. Skype, Xbox)’ and in the ‘Redirect URI (optional)’ section select ‘Web’ and paste the
Redirect Uri from the email account creation page.
Then you need to press the ‘Register’ button.
Once the button is pressed and the new application is successfully registered, the user will be taken to a summary page where he/she must copy the ‘Application (client) ID’
The copied code, the user must paste into the mint configuration in the ‘Client id’ field.
Permissions
The next step is to add permissions. To do this, the user must press the ‘API permissions’ option on the sidebar and then select ‘Add a permission’ on this window.
After pressing the button, press the ‘Microsoft Graph’ option.
Select ‘Delegated permissions’ and check these options:
- IMAP.AccessAsUser.All
- SMTP.Send
- offline_access
And then press the ‘Add permissions’ button.
Client secret
The next step is to go to ‘Certificates & secrets’ which is located on the left sidebar. Then you need to press the ‘New client secret’ button.
Add a description and press the ‘Add’ button.
The user will be taken to the summary. Remember to copy the ‘Value’ field because when you refresh the page, this field will be hidden.
The copied value should be pasted into the MINT configuration in the ‘Client secret’ field.
Saving the connection
To complete the configuration of MINT, select ‘IMAP’ in ‘Receive protocol’ and in the ‘Email address’
field enter the Microsoft Office 365 address from which the configuration was performed.
To complete the configuration process, press the ‘Save’ button. After pressing it the user will be
redirected to Outlook login form. If all the information is correct, the system should connect to Microsoft Office 365 via OAuth2.
After saving, the Redirect URL changes from the ‘create’ endpoint to an ‘edit’ endpoint containing the account’s UUID. Add this URL to the application’s redirect settings in Azure or your OAuth2 provider’s portal.
The sample Redirect URL can look like this below:
Keep in mind that some OAuth2 providers only allow you to generate one refresh token per config. Because of this restriction, you may get an error that you cannot connect to the mailbox. In this case, review the documentation of the provider you are using.
Connection troubleshooting
Note:
If you are still unable to connect your mailbox despite applying the settings described above, ask your application administrator to perform the following steps:
Step 1: Navigate to the following section in Microsoft Entra ID:
Home > Manage > Enterprise applications
Then, go to Security > Consent and permissions.
Step 2: Configure User consent settings section
Under User consent settings, it may be necessary to select the following option: Allow user consent for apps from verified publishers, for selected permissions.
Step 3: Classify permissions
Under Permission classifications > Classify permissions, the administrator may need to classify the following permissions as Low:
- offline_access
- IMAP.AccessAsUser.All
- SMTP.Send
Please note, that the solution described above is provided as an example. The specific settings required may vary depending on your organization’s security policies and configuration.