CleartextStream.ondata error #218

Closed
engram-design opened this Issue May 22, 2013 · 4 comments

Comments

Projects
None yet
2 participants

Getting a strange error with the below code.

See gist for debug output.

server.connect(function(err) {
    server.openBox('INBOX', false, function(err, box) {
        server.search(['ALL'], function(err, results) {
            server.fetch(results, { headers: { parse: true }, body: true, cb: function(fetch) {
                fetch.on('message', function(message) {
                    var body = '';

                    message.on('data', function(chunk) { body += chunk.toString(); });
                    message.on('end', function() { console.log(body); });
                });
            }}, function(err) {});
        });
    });
});
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Command Error. 10
    at CleartextStream.ondata (C:\public_html\node_modules\imap\lib\imap.js:695:17)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at CleartextStream.<anonymous> (_stream_readable.js:710:14)
    at CleartextStream.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:382:10)
    at _stream_readable.js:375:7
    at process._tickCallback (node.js:415:13)
Owner

mscdex commented May 22, 2013

What if you try fetching smaller numbers of messages in a single go (even just 1 for testing purposes)?

Yep, that seems to fix it (using server.search(['ALL', ['SINCE', 'May 22, 2013']], function(err, results). Guess it's just too many emails to handle, so i'll process in chunks. Thanks!

Owner

mscdex commented May 22, 2013

Yeah, plus it's Exchange, so there is that too ;-)

@mscdex mscdex closed this May 22, 2013

Indeed - how I wish I could be using Gmail! :) Thanks for your assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment