IMAP Email - Error: LOGIN failed

IMAP Email - Error: LOGIN failed.

I’m trying to use the IMAP Mail for recieving email and download attachment.
First of all, I’m trying to use the IMAP Mail for my company Outlook Account.
When I try to run it get

Error: LOGIN failed.
    at Connection._resTagged (C:\Users\minhp\AppData\Local\Programs\n8n\resources\app\node_modules\imap\lib\Connection.js:1502:11)
    at Parser.<anonymous> (C:\Users\minhp\AppData\Local\Programs\n8n\resources\app\node_modules\imap\lib\Connection.js:194:10)
    at Parser.emit (node:events:394:28)
    at Parser.emit (node:domain:470:12)
    at Parser._resTagged (C:\Users\minhp\AppData\Local\Programs\n8n\resources\app\node_modules\imap\lib\Parser.js:175:10)
    at Parser._parse (C:\Users\minhp\AppData\Local\Programs\n8n\resources\app\node_modules\imap\lib\Parser.js:139:16)
    at Parser._tryread (C:\Users\minhp\AppData\Local\Programs\n8n\resources\app\node_modules\imap\lib\Parser.js:82:15)
    at TLSSocket.Parser._cbReadable (C:\Users\minhp\AppData\Local\Programs\n8n\resources\app\node_modules\imap\lib\Parser.js:53:12)
    at TLSSocket.emit (node:events:394:28)
    at TLSSocket.emit (node:domain:470:12)
    at emitReadable_ (node:internal/streams/readable:573:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

Please advice me to configure an Organizational Outlook Account.

Hi @Phap_Nguyen, welcome to the community :tada:

I am sorry to hear you’re having trouble here. I was having similar problems and it seems depending on your Active Directory permissions Microsoft doesn’t allow creating app passwords (which would be required here) for your user account for security reasons.

So my suggestion here would be to simply use the designated Outlook node to fetch unread emails (and then mark them as read). This node supports OAuth2 as the authentication method and avoids the aforementioned problem.

Since the Outlook node isn’t a trigger node you’d need to add one more node to regularly check your emails. In this example I am using the Interval node for the job:

Hope this helps!

1 Like