[Resolved] IMAP Mail Fetch not working

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
jeev4
Posts: 1
Joined: Mon Jun 09, 2025 7:53 pm

[Resolved] IMAP Mail Fetch not working

Post by jeev4 »

LXC container running docker instance of hesk

Guide followed for IMAP: https://www.hesk.com/knowledgebase/?article=91

HESK version
3.5.3
PHP version
8.2.25 (MySQLi)
MySQL version
8.0.42
  • IMAP configured with OAUTH using Microsoft Entra ID.
    IMAP Tests successful
    Unread mail in the mailbox for the testing
    Cronjob configured & manually tested
    Debug mode enabled
IMAP Fetching Scope

Code: Select all

openid offline_access https://outlook.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/POP.AccessAsUser.All https://outlook.office365.com/SMTP.Send
https://myurl/inc/mail/hesk_imap.php?key=MYKEY

Code: Select all

#!/usr/bin/php -q

Connected to the IMAP server "outlook.office365.com:993".


Warning: Undefined array key 1 in /srv/inc/mail/imap/OAuthIMAP.php on line 394

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /srv/inc/mail/imap/OAuthIMAP.php on line 395

Warning: Undefined array key 1 in /srv/inc/mail/imap/OAuthIMAP.php on line 396

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /srv/inc/mail/imap/OAuthIMAP.php on line 396

No unread messages found.

Disconnected from the IMAP server.
Apart from that no errors or output when running it manually inside or outside the container:

Code: Select all

docker exec -it docker-hesk-app-1 bash -c 'set -x; php /srv/inc/mail/hesk_imap.php'

Code: Select all

docker exec docker-hesk-app-1 php /srv/inc/mail/hesk_imap.php
I want to add, on step 19, it asks me to login with my m365 account, which I did, but the permission granted screen never appears as per the image.

Resolution
I tried step 19 using Edge (and not firefox or variants of firefox such as Floorp) and it signed me in, and then mail was translated into tickets.
Post Reply