CleartextStream.ondata error #218

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


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) {['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) {});
        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)

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['ALL', ['SINCE', 'May 22, 2013']], function(err, results). Guess it's just too many emails to handle, so i'll process in chunks. Thanks!


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