Mailer Check IMAP poll not working

I have configured mailer check and having the below error

debug: message=self signed certificate, stack=Error: self signed certificate
5|trudesk | at TLSSocket.onConnectSecure (_tls_wrap.js:1502:34)
5|trudesk | at TLSSocket.emit (events.js:314:20)
5|trudesk | at TLSSocket._finishInit (_tls_wrap.js:937:8)
5|trudesk | at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:711:12)
5|trudesk | at Socket.ondata (internal/js_stream_socket.js:77:22)
5|trudesk | at Socket.emit (events.js:314:20)
5|trudesk | at addChunk (_stream_readable.js:297:12)
5|trudesk | at readableAddChunk (_stream_readable.js:272:9)
5|trudesk | at Socket.Readable.push (_stream_readable.js:213:10)
5|trudesk | at TCP.onStreamRead (internal/stream_base_commons.js:188:23), code=DEPTH_ZERO_SELF_SIGNED_CERT, source=socket

If allowing self signed certificate then:

debug: message=Invalid credentials (Failure), stack=Error: Invalid credentials (Failure)
5|trudesk | at Connection._resTagged (/home/helpdesk/public_html/trudesk/node_modules/imap/lib/Connection.js:1502:11)
5|trudesk | at Parser. (/home/helpdesk/public_html/trudesk/node_modules/imap/lib/Connection.js:194:10)
5|trudesk | at Parser.emit (events.js:314:20)
5|trudesk | at Parser._resTagged (/home/helpdesk/public_html/trudesk/node_modules/imap/lib/Parser.js:175:10)
5|trudesk | at Parser._parse (/home/helpdesk/public_html/trudesk/node_modules/imap/lib/Parser.js:139:16)
5|trudesk | at Parser._tryread (/home/helpdesk/public_html/trudesk/node_modules/imap/lib/Parser.js:82:15)
5|trudesk | at TLSSocket.Parser.cbReadable (/home/helpdesk/public_html/trudesk/node_modules/imap/lib/Parser.js:53:12)
5|trudesk | at TLSSocket.emit (events.js:314:20)
5|trudesk | at emitReadable
(_stream_readable.js:557:12)
5|trudesk | at processTicksAndRejections (internal/process/task_queues.js:83:21), type=no, textCode=AUTHENTICATIONFAILED, source=authentication

It was the issue on the configuration. Less secure apps option needs to be on to access the mailbox