emailjs / emailjs-imap-client

Low-level JS IMAP client for all your IMAP needs.
MIT License
557 stars 123 forks source link

unexpected char: 's' #136

Closed RedHatter closed 7 years ago

RedHatter commented 7 years ago

I can't seem to use body.peek. When I run the example query from the documentation I get unexpected char: 's'.

client.listMessages(path, '1:10', ['uid', 'flags', 'body.peek[headers (date)]'])
  .then(console.log)
nifgraup commented 7 years ago

Could you try again with current master?

RedHatter commented 7 years ago

Still happens with 2.0.6-beta.3. Here's the full stacktrace.

Uncaught (in promise) Error: syntax: unexpected char: 's'
    at Object.callback (/home/timothy/Projects/Node/clarity/node_modules/emailjs-imap-client/src/emailjs-imap-client-imap.js:265:37)
    at Imap._handleResponse (/home/timothy/Projects/Node/clarity/node_modules/emailjs-imap-client/src/emailjs-imap-client-imap.js:572:34)
    at Imap._parseIncomingCommands (/home/timothy/Projects/Node/clarity/node_modules/emailjs-imap-client/src/emailjs-imap-client-imap.js:536:18)
    at Imap._onData (/home/timothy/Projects/Node/clarity/node_modules/emailjs-imap-client/src/emailjs-imap-client-imap.js:400:14)
    at socket.ondata (/home/timothy/Projects/Node/clarity/node_modules/emailjs-imap-client/src/emailjs-imap-client-imap.js:135:22)
    at TCPSocket._emit (/home/timothy/Projects/Node/clarity/node_modules/emailjs-tcp-socket/src/emailjs-tcp-socket.js:1088:9)
    at TLSSocket.<anonymous> (/home/timothy/Projects/Node/clarity/node_modules/emailjs-tcp-socket/src/emailjs-tcp-socket.js:318:22)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
andris9 commented 7 years ago

The correct syntax is header.fields not headers, the error is correct

RedHatter commented 7 years ago

@andris9 Thank you!