I am trying to connect Imap in the localhost, but getting a debug log as below, but the username and passwords are correct. I am able to connect through web interface with the login credentials.
<= '* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+'
<= 'A0 OK CAPABILITY completed.'
=> 'A1 LOGIN "************@*****.com" "**************"'
<= 'A1 NO LOGIN failed.'
[connection] Ended
[connection] Closed
[connection] Connected to host
<= '* OK The Microsoft Exchange IMAP4 service is ready. [TQBBAFgAUABSADAAMQAwADEAQwBBADAAMAAyADcALgBJAE4ARABQAFIARAAwADEALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]'
=> 'A0 CAPABILITY'
<= '* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+'
<= 'A0 OK CAPABILITY completed.'
=> 'A1 LOGIN "************@*****.com" "**************"'
<= 'A1 NO LOGIN failed.'
Please anyone help me to resolve this, i checked the complete world of stackoverflow, but nobody couldnt fix this. I appreciate if anyone has the solution.
export const imapConfig = {
imap: {
user: process.env.OUTLOOK_USER,
password: '',
host: process.env.OUTLOOK_HOST,
port: Number(process.env.OUTLOOK_PORT || 993),
tls: true,
authTimeout: 25000,
connTimeout: 30000,
keepalive: true,
secure: true,
debug: console.log
tlsOptions: {
rejectUnauthorized: false
servername: process.env.OUTLOOK_HOST
host: process.env.OUTLOOK_HOST
}
}
}