I am using IMAP NPM to get emails. I wanted to know how i can handle retry mechanism while fetching Email information. Official page don't have any documentation for the same
Code works successfully to fetch Email information. I tried to manually implement Retry mechanism but since many event call backs are involved things are tough. e.g.
Has anyone tried this scenario ? My code snippet is like below
imap.once('ready', function() {
openInbox(function(err, box) {
if (err) throw err;
var f = imap.seq.fetch('1:3', {
bodies: 'HEADER.FIELDS (FROM TO SUBJECT DATE)',
struct: true
});
In above case, instead of throwing error , I would like to call openInbox function again to retry. But it gives error .