Skip to content

Mail event not triggered, and debug logs "IDLE NO Need to SELECT first!" endlessly #925

@RepSklvska

Description

@RepSklvska

Similar to this one, not being triggered when receiving new mails: #889

import Imap, { } from 'imap'

const imapClient = new Imap({
	user: process.env.EMAIL_USERNAME!,
	password: process.env.EMAIL_PASSWORD!,
	host: process.env.IMAP_SERVER!,
	port: Number(process.env.IMAP_PORT),
	tls: true,
	debug: console.log,
})

imapClient.on('mail', (num: number) => {
	console.log('received mail', num)
})

My debug output is different than that one, it's like this and logging endlessly:

[connection] Connected to host
<= '* OK [CAPABILITY IMAP4 IMAP4rev1 ID AUTH=PLAIN AUTH=LOGIN AUTH=XOAUTH2 NAMESPACE] QQMail XMIMAP4Server ready'
=> 'A0 CAPABILITY'
<= '* CAPABILITY IMAP4 IMAP4rev1 XLIST MOVE IDLE XAPPLEPUSHSERVICE SASL-IR AUTH=PLAIN AUTH=LOGIN AUTH=XOAUTH2 NAMESPACE CHILDREN ID UIDPLUS'
<= 'A0 OK CAPABILITY Completed'
=> 'A1 LOGIN "xxxxxxx@qq.com" "xxxxxxx"'
<= 'A1 OK Success login ok'
=> 'A2 CAPABILITY'
<= '* CAPABILITY IMAP4 IMAP4rev1 XLIST MOVE IDLE XAPPLEPUSHSERVICE NAMESPACE CHILDREN ID UIDPLUS COMPRESS=DEFLATE'
<= 'A2 OK CAPABILITY Completed'
=> 'A3 NAMESPACE'
<= '* NAMESPACE (("" "/")) NIL NIL'
<= 'A3 OK NAMESPACE Success'
=> 'A4 LIST "" ""'
<= '* LIST (\\NoSelect) "/" "/"'
<= 'A4 OK LIST completed'
=> 'IDLE IDLE'
<= 'IDLE NO Need to SELECT first!'
=> 'IDLE IDLE'
<= 'IDLE NO Need to SELECT first!'
=> 'IDLE IDLE'
<= 'IDLE NO Need to SELECT first!'
=> 'IDLE IDLE'
<= 'IDLE NO Need to SELECT first!'
=> 'IDLE IDLE'
<= 'IDLE NO Need to SELECT first!'
=> 'IDLE IDLE'
<= 'IDLE NO Need to SELECT first!'
=> 'IDLE IDLE'
<= 'IDLE NO Need to SELECT first!'

Can it be a server side issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions