Fix exception when all fetch bodies return at once
@ -1115,7 +1115,8 @@ Connection.prototype._resUntagged = function(info) {
if (toget.length === 0) {
process.nextTick(function() {
msg.ended = true;
if (msg)
msgEmitter.emit('attributes', attrs);
msgEmitter.emit('end');
});
@ -53,7 +53,8 @@ srv.listen(0, '127.0.0.1', function() {
user: 'foo',
password: 'bar',
host: '127.0.0.1',
port: port
port: port,
keepalive: false
imap.on('ready', function() {
imap.openBox('INBOX', true, function() {