Chirag Jain
Chirag Jain
Mail listener already emit these events. See if below example makes sense to you. ``` mailListener.on("server:error", function(error){ console.log('imap error') }); mailListener.on("server:disconnected", function(){ // restart here }); ```
Ok. got it. I will leave this to @podviaznikov
@anotheri till then you might want to start your script with forever. Shall give you some good sleep. Haha :)
Not sure if this is relevant but i tried to start mail-listener and kept it on server. Its still connected and running from last 5hours.
Do you want a callback when all the mails are parsed or when all the mails are fetched? I might be able to send a PR for this as well.
Yes, I know about the callback that you asking about. But the thing is, mail-listener will call mailparser in the cb function which emits mail:parsed event. This mail:parsed event will...
@anotheri I think i will be able to do that for you by eod.
@anotheri sorry man! busy with other stuff. Will try to take some time out for this.
Yeah node-imap changed. I rewrote this lib. Check https://github.com/chirag04/mail-listener2
feel free to send a PR :)