Repository navigation
Microsoft Graph Email Collection #529
ophsr
started this conversation in
Ideas and feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Contribution description
Currently, GLPI can collect emails through the IMAP protocol using OAuth authentication configured through the OAuth IMAP plugin.
This model may not be suitable for organizations that:
Proposed feature
Add a new email collection mode to GLPI through the OAuth IMAP plugin:
The new mode would allow GLPI to collect emails directly through the Microsoft Graph API using the OAuth 2.0 Client Credentials flow, without an IMAP connection or interactive mailbox login.
Microsoft Graph API collection behavior
Example workflow
support@company.com.Proposed configuration
A new provider type could be added to the GLPI email receiver configuration:
GLPI must store the client secret in encrypted form and must not display it again after the configuration is saved.
Certificate-based authentication should also be supported and presented as the recommended option for organizations that do not allow long-lived client secrets.
Proposed technical implementation
Authentication
GLPI should use the OAuth 2.0 Client Credentials flow to request an access token:
GLPI should cache the token temporarily and securely, and request a new token before it expires.
The token must not be stored permanently or written to logs.
Message collection
After obtaining the token, GLPI should query the messages from the configured mailbox and folder:
The GLPI implementation should support:
@odata.nextLink.Attachment collection
GLPI should retrieve attachments using the endpoint associated with the message:
GLPI should support standard file attachments and define the expected behavior for:
Ticket creation
After retrieving a message, GLPI should use the existing email receiver workflow to:
If the sender does not match an existing user, GLPI should follow the behavior already configured for unknown senders.
Post-processing action
After a ticket is created successfully, GLPI should execute the configured action for the message:
The action must only be performed after GLPI confirms that the ticket was created successfully.
If ticket creation fails, the message must remain available for another attempt, and the error must be recorded.
Required permissions
The App Registration should have the following Microsoft Graph application permission so that GLPI can read messages:
If GLPI needs to mark, move or delete messages, the following permission will be required:
Application permissions require administrative consent in Microsoft Entra ID.
It is also recommended to restrict the application to only the mailboxes used by GLPI through the access-control mechanisms available in Exchange Online. This prevents the credentials configured in GLPI from granting unrestricted access to every mailbox in the organization.
Security and reliability requirements
GLPI should:
Retry-Afterresponse header.Benefits
No IMAP dependency.
GLPI can collect emails even when the IMAP protocol is disabled.
No interactive mailbox login.
GLPI is authenticated as an application and does not depend on a service-account session.
Compatibility with Microsoft 365 security policies.
The integration uses application permissions, administrative consent and centrally managed credentials.
Improved credential management.
Authentication can use certificates or secrets with controlled validity and rotation.
Restricted mailbox access.
Administrators can limit the application to only the mailboxes used by GLPI.
Existing GLPI behavior is preserved.
Messages continue to be processed through the existing email receivers and rules.
Improved traceability.
GLPI can record the collection status, processed messages and integration errors.
Acceptance criteria
Expected result
GLPI can collect Microsoft 365 emails directly through the Microsoft Graph API using the credentials of an Azure/Microsoft Entra ID App Registration, without depending on the IMAP protocol or interactive mailbox authentication.
GLPI itself is responsible for requesting and renewing the access token, retrieving and processing messages, creating tickets and performing the configured post-processing action, while preserving the existing receiver rules and requester identification based on the email sender.
All reactions