|
|
|
@ -452,19 +452,20 @@ ImapConnection.prototype.connect = function(loginCb) {
|
|
|
|
|
self.debug&&self.debug('[parsing incoming] saw untagged ' + m[1]);
|
|
|
|
|
switch (m[1]) {
|
|
|
|
|
case 'OK':
|
|
|
|
|
var code = m[2];
|
|
|
|
|
if (state.status === STATES.NOAUTH) {
|
|
|
|
|
if (!state.isReady) {
|
|
|
|
|
state.isReady = true;
|
|
|
|
|
state.conn.emit('ready');
|
|
|
|
|
}
|
|
|
|
|
} else if (/^ALERT$/i.test(m[2]))
|
|
|
|
|
} else if (/^ALERT$/i.test(code))
|
|
|
|
|
self.emit('alert', m[3]);
|
|
|
|
|
else if (state.status === STATES.BOXSELECTING) {
|
|
|
|
|
if (m = /^UIDVALIDITY (\d+)/i.exec(m[2]))
|
|
|
|
|
if (m = /^UIDVALIDITY (\d+)/i.exec(code))
|
|
|
|
|
state.box.uidvalidity = m[1];
|
|
|
|
|
else if (m = /^UIDNEXT (\d+)/i.exec(m[2]))
|
|
|
|
|
else if (m = /^UIDNEXT (\d+)/i.exec(code))
|
|
|
|
|
state.box.uidnext = m[1];
|
|
|
|
|
else if (m = /^PERMANENTFLAGS \((.*)\)/i.exec(m[2])) {
|
|
|
|
|
else if (m = /^PERMANENTFLAGS \((.*)\)/i.exec(code)) {
|
|
|
|
|
var idx, permFlags, keywords;
|
|
|
|
|
state.box.permFlags = permFlags = m[1].split(' ');
|
|
|
|
|
if ((idx = state.box.permFlags.indexOf('\\*')) > -1) {
|
|
|
|
|