Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RepSklvska opened this issue Jan 31, 2025 · 0 comments

Comments

@RepSklvska
Copy link

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 "[email protected]" "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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant