From 1e1031f06d92a4bb3071b5bd32f8588a1e570d36 Mon Sep 17 00:00:00 2001 From: Vytautas Jakutis Date: Fri, 18 Feb 2011 22:10:00 +0800 Subject: [PATCH] fixes the ImapConnection.getBox method. the code is: console.log(params); var imap = new require('../submodules/node-imap/imap').ImapConnection({ username: params.username, password: params.password, host: params.hostname, port: params.port, secure: true }); imap.connect(function(r, err) { if(err) { console.log('Connection failed. Quitting.'); } else { imap.getBoxes(function() { console.log(arguments); console.log('Done. Quitting.'); imap.logout(); }); } }); the output is: { hostname: '*******', port: '993', username: '*******', password: '*******' } /home/tahu/workspace/mailget/submodules/node-imap/imap.js:292 if (!curChildren[path[i]].children) ^ TypeError: Cannot read property 'children' of undefined at CleartextStream. (/home/tahu/workspace/mailget/submodules/node-imap/imap.js:292:42) at CleartextStream.emit (events.js:42:17) at CleartextStream._push (tls.js:257:31) at SecurePair._cycle (tls.js:514:18) at EncryptedStream.write (tls.js:72:13) at Socket.ondata (stream.js:15:26) at Socket.emit (events.js:42:17) at Socket._onReadable (net.js:649:14) at IOWatcher.onReadable [as callback] (net.js:156:10) --- imap.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imap.js b/imap.js index d410bba..39dbeba 100644 --- a/imap.js +++ b/imap.js @@ -289,6 +289,8 @@ ImapConnection.prototype.connect = function(loginCb) { var path = name.split(box.delim).filter(isNotEmpty), parent = null; name = path.pop(); for (var i=0,len=path.length; i