Open SashaJson opened 3 years ago
Having the same issue. Have you managed to solve this? I believe it gets messy when trying to do multiple things in a single connection
This happens mostly when you're making multiple connections .I've facing this issue for quite some time and the only possible solution I found is adding and If condition in the node_modules/imap/lib/Connection.js. This really is a headache hope the check will be officially added in the module
here's my code: file name: node_modules/imap/lib/Connection.js.
parser.on('continue', function(info) {
if(self._curReq)
{ var type = self._curReq.type;
if (type === 'IDLE') {
if (self._queue.length
&& self._idle.started === 0
&& self._curReq
&& self._curReq.type === 'IDLE'
&& self._sock
&& self._sock.writable
&& !self._idle.enabled) {
self.debug && self.debug('=> DONE');
self._sock.write('DONE' + CRLF);
return;
}
// now idling
self._idle.started = Date.now();
} else if (/^AUTHENTICATE XOAUTH/.test(self._curReq.fullcmd)) {
self._curReq.oauthError = new Buffer(info.text, 'base64').toString('utf8');
self.debug && self.debug('=> ' + inspect(CRLF));
self._sock.write(CRLF);
} else if (type === 'APPEND') {
self._sockWriteAppendData(self._curReq.appendData);
} else if (self._curReq.lines && self._curReq.lines.length) {
var line = self._curReq.lines.shift() + '\r\n';
self.debug && self.debug('=> ' + inspect(line));
self._sock.write(line, 'binary');
}}
else{
console.log("self._curReq.type not found")
return;
}
});
i make connect to box, but without close connect when total message === 0
debug log when do not close connect
and after that check email in box debug log for this step
after that delete message and again check email in box, but this moment received Error debug log from this step
Connection.js line - 1279