No IMAP Fetching (O365, OAuth)

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
nivmore
Posts: 2
Joined: Thu Dec 29, 2022 10:45 am

No IMAP Fetching (O365, OAuth)

Post by nivmore »

Version of script: 3.4.2
Hosting company: Netcup
What terms did you try when SEARCHING for a solution:

Write your message below:
Hello,
Since yesterday the IMAP fetching doesn't work anymore. Manually calling hesk_imap.php in debug mode says there are no "unread" emails. To be on the safe side, I completely recreated the OAuth access and checked the cronjob. Everything OK. According to Outlook, there are currently 14 unread e-mails in the mailbox. What could be the problem?

Code: Select all

Connected to the IMAP server "outlook.office365.com:993".
No unread messages found.
Disconnected from the IMAP server.
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: No IMAP Fetching (O365, OAuth)

Post by Klemen »

This is usually a problem when OAuth is registered using a different account than the email account you use in fetching.

See this article at the bottom, find "Hesk can connect to Office 365, but it doesn't find any unread emails (or downloads incorrect emails)":
https://www.hesk.com/knowledgebase/?article=110
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
nivmore
Posts: 2
Joined: Thu Dec 29, 2022 10:45 am

Re: No IMAP Fetching (O365, OAuth)

Post by nivmore »

Hi,
Thank you for the fast answer.
I had already read and followed the post. That's why I created the app from scratch in Azure. The app is in the support@ account. After that I made the connection with the data of the support@ account again in Hesk in Incocnito mode. Is there anything else I can do? I also don't understand why Hesk has been working great for over 4 months and suddenly it doesn't work?
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: No IMAP Fetching (O365, OAuth)

Post by Klemen »

Not sure what is going on and unfortunately, I can't be of much help here without access to both the help desk and the Azure Administration.

One thing you can check is if you have a custom folder called "inbox" created inside your support mailbox (which is empty of unread emails). If yes, delete the custom "inbox" folder and see if that helps.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
VidiotsAGL
Posts: 5
Joined: Fri Jun 23, 2023 10:11 pm

Re: No IMAP Fetching (O365, OAuth)

Post by VidiotsAGL »

I know this is kind of an old post but i had this same problem and figured it out.

Attention to signon and cookies is important.
I am the IT admin. I have an o365 login a-me@domain.com
I'm setting up support@domain.com for the ticketing IMAP.

I followed the guide, created the things in the azure side, logged in as support@domain.com

I went back to my original window where i'm configuring Hesk and finished the registration and saved.
It authenticated the signon with a-me@domain.com even though i created it with support@

so, in summary. do the whole process, start to finish, both of your hosted and the azure hosted items in each of their own private browser windows, just to make sure that you've got clean sessions.

lastly, using the 'test imap' and noticing that it will now say "2 new emails will be sent" does not also run the
https://yoursite.com/hesk/inc/mail/hesk ... and_things
line that you need to have in cron or run manually



hope this helps someone!
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: No IMAP Fetching (O365, OAuth)

Post by Klemen »

Thanks for sharing.

Just for reference, using Private browser mode is also recommended in the article (see Common problems and error messages at the bottom):
https://www.hesk.com/knowledgebase/?article=110
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
ainarp
Posts: 4
Joined: Tue Jul 18, 2023 7:29 pm

Re: No IMAP Fetching (O365, OAuth)

Post by ainarp »

Hello

Our IMAP server displays the message "Success: Connection successful! Number of emails your mail server will send to Hesk: 3", indicating that the connection has been established successfully and that there are three emails to be sent to Hesk.

However, for some reason, the corresponding tickets are not being created in the system as expected. I have checked our settings and everything seems to be configured correctly, which is why I am unsure why this issue is occurring.

Would you happen to have any insights into what might be causing this problem? Your expertise and assistance would be greatly appreciated in this matter.

Thank you for your time and I look forward to hearing from you soon.
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: No IMAP Fetching (O365, OAuth)

Post by Klemen »

Did you go through all of the IMAP fetching steps?
https://www.hesk.com/knowledgebase/?article=91
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
ainarp
Posts: 4
Joined: Tue Jul 18, 2023 7:29 pm

Re: No IMAP Fetching (O365, OAuth)

Post by ainarp »

Thank you. The issue has been resolved - the problem was with a server-side cron job.
Post Reply