Important: in order to authenticate through Azure AD you need to have Mail Gateway version 2.1.13.0 or later
Follow these steps to configure authentication for Mail Gateway against Azure AD:
https://login.microsoftonline.com/common/oauth2/nativeclient as the URI.EWS.AccessAsUser.All permission and click Save.mailbox elements in the Mail Gateway configuration file:
A sample of how the configuration should look can be found here and the actual configuration file can be found either through the software Mail Gateway Configurator or the file MailGateway.Service.exe.config found in the installation folder, typically C:\Program Files (x86)\Lundalogik\LIME Pro Mail Gateway