Skip to content


How do I install OAuth IMAP?

You will find a procedure to help you install and configure the plugin.

What are the features of OAuth IMAP?

OAuth IMAP allows one of your tenant accounts to use IMAP services securely. With OAuth IMAP you can, for example, use the collector with a company mailbox.

Is the MFA compatible with OAuth IMAP?

Yes, you can use OAuth IMAP with the MFA. You will be asked for 1st authentication when requesting creation of authorisation.

I have a security policy requiring daily logon with dual authentication, does this also affect the account using OAuth IMAP?

The Oauth tokens for the collector, retrieved during authentication with Azure by the OauthIMAP plugin, are "offline" tokens that delegate authorisation to a third-party application (GLPI). These tokens provide a renewal code that will be used by the application to renew them automatically without user intervention. The daily re-authentication strategy only concerns 'online' authentication and only applies to services accessed directly by the user, for example via their Internet browser.

I have a connection error, how can I fix it?

From setup > OAuth IMAP applications, tab OAuth authorisation click on diagnose. In the window that opens, increase the timeout to 15 (minimum). An error message will appear at the bottom of the log to guide you to the problem you are experiencing.

If you have changed the password for the account using IMAP services, remember to update the account from configuration > OAuth IMAP applications, tab OAuth authorisation, button update.

Where are the application logs (on-premise only)?

If you have a problem, you can check the php-errors.log logs in the files/_log folder with the command (for example) tail -f php-errors.log | grep "imap" -C5

glpi_files/_log$ tail -f php-errors.log | grep "imap" -C5
[2024-01-18 16:20:04] glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Storage\Exception\RuntimeException: cannot login, user or password wrong in / at line 76
 Backtrace :
...authimap/inc/mailcollectorfeature.class.php:101 GlpiPlugin\Oauthimap\Imap\ImapOauthStorage->__construct()
src/Toolbox.php:2222 GlpiPlugin\Oauthimap\MailCollectorFeature::GlpiPlugin\Oauthimap\{closure}()
src/MailCollector.php:1434 Toolbox::getMailServerStorageInstance()
src/MailCollector.php:708 MailCollector->connect()
src/MailCollector.php:1921 MailCollector->collect()
src/CronTask.php:1037 MailCollector::cronMailgate()
front/cron.php:87 CronTask::launch()

In this example, we can see that there is a problem with the user and/or the password.

Last update: 18/01/2024