Closed patryk-matis closed 3 years ago
I'm trying to make this work:
const config = { imap: { user: process.env.EMAIL_ACCOUNT, password: process.env.EMAIL_PASSWORD, host: process.env.HOST, port: 993, tls: true, authTimeout: 3000 }, onclose: function(){ console.log("onclose"); }, onend: function(){ console.log("onend"); }, onupdate: function(){ console.log("update"); connection.end(); }, } const connection = await imaps.connect(config); connection.openBox('INBOX');
But onclose and onend listeners are not doing anything? Console prints only "update". Then connection is ended.
I had to use handlers outside of a config. Everything works fine.
I'm trying to make this work:
But onclose and onend listeners are not doing anything? Console prints only "update". Then connection is ended.