Cannot connect the Custom office365 Mail


We have a Custom Office365 mail account that we are trying to receive email through imap node.
But we cannot connect with the host and port addresses that is given by microsoft.

I just want to make sure, IMAP node is working with Custom Office365 Mails right? What we do wrong here?


Hey @onurbolaca,

For issues like this the template we provide is very helpful.

Can you confirm how you are running n8n, what version of n8n you are running and what error message you see when trying to connect.

Hey @Jon,

You’re right, I was in a hurry.

I’m using self-hosted n8n with Version 0.213.0

I must use the Imap node, not any other node.

Here some more details:

I can easily connect and get the mails through IMAP node with
Yahoo - App Password,
Gmail - App Password,
Hotmail/Outlook personal account,
[email protected] kind of business account (I opened a test account),
Custom mail provider’s Imap mail server.

  • But when it comes to this business account (shown in red) of office365, it doesn’t connect.
  • This account has a Domain Registrar called Raidboxes but it’s email hosting provider is Microsoft 365:

I searched and there seems to be no option of app password for Office 365 mail account. But there is enable option for exchange accounts. I will check that out too with my customer.

Have you ever live this problem? Or what might be the problem?

We might need to update the imap documentation according to business accounts of office365 if they need some special requirement:

Hey @onurbolaca,

So it should work but that login fail message would suggest something with the account or credentials.

I have used Microsoft365 with a business account before so know it does work and it can work with an app password if you have one available. If you are not seeing the app password option you might need to enable MFA in your account for it to show.

If you already have MFA enabled that could be why it can’t login. One thing I can’t remember is if it needed IMAP enabling at the account level.

1 Like

And @Jon I wonder,

Is connecting with IMAP node basic auth?

And I checked that MFA is enabled but I still cannot add app password. I wonder if this feature is no longer available on office365 or not.

Does this article make sense to you?

Hey @onurbolaca,

The feature should still be available I can’t see it being removed, To set one up it should be the settings on this page: Manage app passwords for two-step verification - Microsoft Support

It could be that the account is set to modern authentication only which would cause an issue with IMAP some IMAP clients and if that is the case you would need to use a schedule node with the Outlook node to achieve the same thing.

I have found something like this:

I think this would work for me, you can add trusted ips for spesific apps to not to use multi-factor auth

That might work but I wouldn’t do it not when it says there that users can make app passwords.

1 Like

Hey @onurbolaca,

Another quick one… @MutedJam has just reminded me about this : Deprecation of Basic authentication in Exchange Online | Microsoft Learn

It could be that you just can’t use the IMAP node anymore because of this change and you will have to use the schedule and outlook node to do the same thing.

Hey @Jon ,

But the things is I can connect with my Office365 account with IMAP node but I cannot connect with the client’s Office365 account.

Hey @onurbolaca,

Is your account a Microsoft 365 one as well or an one and did you have it enabled before the cut off?

It could be that you need to open a case with Microsoft Support to find out why IMAP isn’t working.

It’s a Microsoft 365 account not a personal outlook account.

“did you have it enabled before the cut off?” - I didnt get this part @Jon

I will check with Microsoft Support if the solution above wouldnt work.

And it might be a good idea to add the explanation once it is solved to IMAP node document.

Hey @onurbolaca,

The notice from Microsoft mentions that if basic auth was not enabled before December 21st 2022 you won’t be able to enable it.

If Basic authentication has been disabled in your tenant and users and apps are unable to connect, you have until Dec 31, 2022, to re-enable the affected protocols. Follow the re-enablement process in this blog. Once that date has passed, you (or support) cannot re-enable Basic authentication in your tenant.

Looks like this also impact App Passwords as well so we might need to add a note to the docs to say that Microsoft 365 is currently not supported and to use the work around. I will get an internal ticket created so that we can either add oauth to the imap node or create an outlook trigger node to make life a little bit easier.

I also found this page that might be useful: Basic Authentication Deprecation in Exchange Online – Time’s Up - Microsoft Community Hub

1 Like

Hey @Jon,

Yes, it looks like basic auth is deprecated for imap but it also says that we can able some ip addresses to use basic auth not the two way auth:

I’m being stubborn to not to change my node because I build a whole imap flow generation system per user and since I promise to customer it would work with every mail provider, I might have to work extra hours to change my workflow generator. And dealing with json is a pain :slight_smile:

Do you think this allowing ip method would work or it is also deprecated @Jon
? :slight_smile:

Hey @onurbolaca,

I don’t know if the IP method is deprecated but that is out of our hands :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.