node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

Remove useless mail event with entire that counts entire box as new after openBox

Open freman opened this issue 11 years ago • 2 comments

var Imap = require('map');
var imap = new Imap(opts);

imap.once('ready', function() {
    imap.openBox('INBOX', true, function(err, box) {
        console.log('Got inbox', box.messages.total);
    });
});

imap.on('mail', function(new) {
    console.log('New mail', new);
});

Before this patch the above code would print out

Got inbox 5052
New mail 5052
# Then when an actual message came in
New mail 1

Now the code above prints

Got inbox 5052
# Then when an actual message comes in
New mail 1

freman avatar Dec 16 '14 05:12 freman

Any updates on this? It seems this is a pretty clean fix to https://github.com/mscdex/node-imap/issues/445, would be really great to merge it in.

bengotow avatar Jun 20 '16 06:06 bengotow

@mscdex any chance we could merge this in?

jstejada avatar Jan 12 '17 08:01 jstejada