Page 1 of 1

POP3 an IMAP connecting to Office365 account

Posted: Tue Jun 14, 2022 6:46 pm
by jstanley
Script URL:
Version of script: 3.2.5
Hosting company: Krystal.uk
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
I am trying to configure POP3 or IMAP Fetching using a Office 365 fully licenced user mailbox with POP and IMAP turn on.

For POP3 I've tried the following settings in HESK:
Host: outlook.office365.com
Port: 995
TLS
email address and password of the account I wish to check for messages. (below I have changed these to xyz)

With the above I get the following error:
Error: Password error: Logon failure: unknown user name or bad password.
Connecting to outlook.office365.com ...
S +OK The Microsoft Exchange POP3 service is ready. [TABPADIAUAAyADYANQBDAEEAMAAxADMAMQAuAEcAQgBSAFAAMgA2ADUALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
C USER xyz@xyz.com
S +OK
C PASS xyz
S -ERR Logon failure: unknown user name or bad password.

However, I know the username and password is correct as I am using the same credentials for the SMTP connection which is working and I am also able to log into OWA with the same credentials.

For IMAP I've tried the following settings in HESK:
Host: outlook.office365.com
Port: 993
SSL
Do not validate certificate
email address and password of the account I wish to check for messages.

With the above I get the following error:
Error: Can not authenticate to IMAP server: AUTHENTICATE failed.
Retrying PLAIN authentication after AUTHENTICATE failed.
Retrying PLAIN authentication after AUTHENTICATE failed.
Can not authenticate to IMAP server: AUTHENTICATE failed.

It seems whatever combination of settings I try I cannot get either of these to work.

I've checked with my web host and they are not blocking any of the above ports.

Any suggestions on what the issue might be or what to try next.

Many thanks

Re: POP3 an IMAP connecting to Office365 account

Posted: Tue Jun 14, 2022 6:48 pm
by Klemen
Maybe you need to create an app password for Hesk?
https://support.microsoft.com/en-us/acc ... 07799387e9

You may also need to enable basic authentication for IMAP and disable Azure Active Directory security defaults:
https://docs.microsoft.com/en-us/exchan ... ap-outlook

Re: POP3 an IMAP connecting to Office365 account

Posted: Tue Jun 14, 2022 6:55 pm
by jstanley
Klemen wrote: Tue Jun 14, 2022 6:48 pm Maybe you need to create an app password for Hesk?
https://support.microsoft.com/en-us/acc ... 07799387e9

You may also need to enable basic authentication for IMAP and disable Azure Active Directory security defaults:
https://docs.microsoft.com/en-us/exchan ... ap-outlook
Thanks, I've checked and basic authentication is already enabled and we therefore do not use MFA.

Re: POP3 an IMAP connecting to Office365 account

Posted: Tue Jun 14, 2022 6:58 pm
by Klemen
Can you try (at least temporarily) disabling Azure Active Directory security defaults, then waiting a few hours and see if that helps?
https://docs.microsoft.com/en-us/micros ... -worldwide

Re: POP3 an IMAP connecting to Office365 account

Posted: Tue Jun 14, 2022 7:11 pm
by jstanley
Klemen wrote: Tue Jun 14, 2022 6:58 pm Can you try (at least temporarily) disabling Azure Active Directory security defaults, then waiting a few hours and see if that helps?
https://docs.microsoft.com/en-us/micros ... -worldwide
I disabled Azure Active Directory security defaults earlier today but unfortunately it hasn't made any difference

Re: POP3 an IMAP connecting to Office365 account

Posted: Tue Jun 14, 2022 7:31 pm
by Klemen
It's definitely something in the O365 settings (not your web host) because the connection to the O365 server is OK, the authentication fails. And I know several people who use O365 without problems in Hesk.

Are you able to create an app password even if you MFA disabled in O365?

Re: POP3 an IMAP connecting to Office365 account

Posted: Thu Jun 23, 2022 6:30 pm
by MaxAsford
Hi, today this problem happened to me.

I tried everything that was said here...
I even tried the beta and stable version with a clean install.

Unfortunately, nothing worked.

Does anyone have a solution?

Re: POP3 an IMAP connecting to Office365 account

Posted: Tue Nov 01, 2022 6:06 pm
by geffiams
Hello Jstanley,
This error comes about if you have activated OAUTH with a different email other than the one you are trying to use for pop. Ensure the email you inted to use for POP3 is the same as the one you have used to verify OAUTH.