Fetches mail from Microsoft 365 using the Microsoft Graph API. This was written eliminate the use of IMAP with pulling mail from 365 accounts as Microsoft has been actively trying to eliminate it for years.
- Copy the
/msgraph/
folder to the/include/plugins/
in your OSTicket installation. - Install and enable the plugin as outlined here: https://docs.osticket.com/en/latest/Admin/Manage/Plugins.html
- Register a new app for OSTicket in Azure AD as outlined here: https://learn.microsoft.com/en-us/graph/auth-v2-service?context=graph%2Fapi%2F1.0&view=graph-rest-1.0
- Durring registration select "Accounts in this organizational directory only" and leave Redirect URI blank.
- Under "API Permissions", add the following permissions to the app under Microsoft Graph API > Application permissions > Mail:
Mail.ReadWrite, User.Read.All
- Provide Admin consent for these permissions.
- Under "Certificates & secrets", add a new client secret and note the value of it for later. When asked for an expiration, I would suggest 24 months if you don't want to have to update this value in OSTicket often.
- Under "Overview", note the value of "Application (client) ID" down for later.
- In your OSTicket Admin Panel, go to Manage > Plugins.
- Click on "Microsoft Graph API Mailfetcher".
- Provide values for the settings here. If you don't know your Tenant Id, follow the directions here: https://learn.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-to-find-tenant
- Click "Save Changes". A test connection will be made to validate the settings here and you will recieve errors if there are issues to resolve.
- If you haven't done so, I would highly recommend you setup external cron handling: https://docs.osticket.com/en/latest/Developer%20Documentation/API/Tasks.html