|
|
@ -642,6 +642,7 @@ ImapConnection.prototype.connect = function(loginCb) {
|
|
|
|
if (line[0] === '+') {
|
|
|
|
if (line[0] === '+') {
|
|
|
|
if (requests[0].cmd !== 'APPEND') {
|
|
|
|
if (requests[0].cmd !== 'APPEND') {
|
|
|
|
err = new Error('Unexpected continuation');
|
|
|
|
err = new Error('Unexpected continuation');
|
|
|
|
|
|
|
|
err.level = 'protocol';
|
|
|
|
err.type = 'continuation';
|
|
|
|
err.type = 'continuation';
|
|
|
|
err.request = cmdstr;
|
|
|
|
err.request = cmdstr;
|
|
|
|
} else
|
|
|
|
} else
|
|
|
@ -651,6 +652,7 @@ ImapConnection.prototype.connect = function(loginCb) {
|
|
|
|
// m[2]: resp-text-code
|
|
|
|
// m[2]: resp-text-code
|
|
|
|
// m[3]: message
|
|
|
|
// m[3]: message
|
|
|
|
err = new Error(m[3]);
|
|
|
|
err = new Error(m[3]);
|
|
|
|
|
|
|
|
err.level = 'protocol';
|
|
|
|
err.type = 'failure';
|
|
|
|
err.type = 'failure';
|
|
|
|
err.code = m[2];
|
|
|
|
err.code = m[2];
|
|
|
|
err.request = cmdstr;
|
|
|
|
err.request = cmdstr;
|
|
|
@ -718,7 +720,9 @@ ImapConnection.prototype.connect = function(loginCb) {
|
|
|
|
state.tmrConn = setTimeout(function() {
|
|
|
|
state.tmrConn = setTimeout(function() {
|
|
|
|
state.conn.destroy();
|
|
|
|
state.conn.destroy();
|
|
|
|
state.conn = undefined;
|
|
|
|
state.conn = undefined;
|
|
|
|
loginCb(new Error('Connection timed out'));
|
|
|
|
var err = new Error('Connection timed out');
|
|
|
|
|
|
|
|
err.level = 'timeout';
|
|
|
|
|
|
|
|
loginCb(err);
|
|
|
|
}, this._options.connTimeout);
|
|
|
|
}, this._options.connTimeout);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|