HTTPS Required - Microsoft requires the FlexDeploy to be hosted via HTTPS to use Microsoft OAuth.
Create the Application in Azure AD
See the page Creating and connecting to an Office 365 Graph email application compatible with FlexDeploy for directions to create a suitable application in Azure. Then resume with this page when ready.
Update FlexDeploy System Settings
Next, go to System Settings → Email Settings and select OAuth for the SMTP or IMAP auth types. Note that although it is displayed as SMTP or IMAP, it is not going to use SMTP or IMAP.
SMTP User - This is the user that will be logging in to graph with
SMTP OAuth Application - Choose the OAuth application you just created.
SMTP From Address - The user must have permission to send from this address, or it won’t work. This can be a shared mailbox.
Validate
Once authorization is complete, you can test the configuration by clicking on the Test Email Configuration button located at the bottom next to Save.
Sends a test email to the logged in user's email address to validate the SMTP OAuth settings.
Reads the inbox of the Approval Reply Address to validate the IMAP OAuth settings.
Setting Up Email Approvals
If you are using the same user for outgoing and incoming emails (recommended) then you can leave the top of the section titled IMAP Settings mostly blank like this:
Email Reply Options
Email Reply Folder - This is the folder (can be a shared folder) that will have all mail processed and deleted from it by FlexDeploy. You cannot use the same folder for dev and prod FlexDeploy servers, as one of the servers will read and delete the mail, and the other will not get the mail. You could use one user account, as long as you use separate folders. Inbox is likely the value that you want. However, if you use Inbox, and test it with your personal email address, all your email will be irrecoverably lost.
Approval Reply Address - This defaults to the same as the SMTP from address, and works with shared mailboxes. When users click reply to the emails FlexDeploy send, it should be routed into the folder that you specified above.
Validate
Once authorization is complete, you can test the configuration by clicking on the Test Email Configuration button located at the bottom next to Save.
Sends a test email to the logged in user's email address to validate the SMTP OAuth settings.
Reads the inbox of the Approval Reply Address to validate the IMAP OAuth settings.