341 Commits (3e532e3ff62a2c7810ee518465fa271d7c5bad75)

Author SHA1 Message Date
Brian White 15ee85e7b9 Connection: lint 10 years ago
Brian White 060a50a6e8 Connection: add configurable authentication timeout 10 years ago
Brian White 94bd04544c Parser: check regexp success before trying to use captures 10 years ago
Brian White a607d1edae Connection: convert `bodies` specifiers to strings before parsing 10 years ago
Brian White 9e16442688 Connection: fix 'mail' event argument 10 years ago
Brian White c94cc42a84 Connection: add guard in destroy() 10 years ago
Chotiwat Chawannakul 01c855ea08 Connection: fix an issue with mailboxes that don’t support modseq (NOMODSEQ) 10 years ago
Brian White bf919af813 Connection: ensure non-empty seqno/uid lists 10 years ago
Brian White 4a56566590 Merge pull request #323 from dominikgehl/dgl/RFC6154
added special_use_attrib
10 years ago
Brian White 93308c64e5 Connection: for BODY[] part expressions, switch from string comparison to parsed expression comparison 11 years ago
Brian White 0a7a5e80ff Parser: properly handle escaped double quotes and backslashes in quoted strings 11 years ago
Brian White 609cde6ee1 Parser: don't add quoted body to attributes after we streamed it 11 years ago
Brian White 051a115444 Merge pull request #330 from juhovh/master
Remove useless _tryreads because they cause problems.
11 years ago
Brian White 6084484218 Connection: for NOOP, make sure to re-NOOP when still idle 11 years ago
Brian White 89aef1b73d Parser: check stream readable before read() 11 years ago
Juho Vähä-Herttua 130f1bea74 Remove useless _tryreads because they cause problems.
These cases are already handled in _parse function.
11 years ago
Brian White d4e7eb6257 Parser: check for non-literal bodies in FETCH 11 years ago
Dominik Gehl 38373c34d7 added special_use_attrib 11 years ago
Dominik Gehl 36a1280abd decode envelope subject 11 years ago
Dominik Gehl 8ed32d7fa9 added support for ENVELOPE fetch 11 years ago
Brian White 32445a188b lint 11 years ago
Brian White 9a961cc35c Connection: add guard when updating name of currently open box during rename 11 years ago
Brian White f83449f801 Connection: add persistentUIDs property to Box objects 11 years ago
Brian White 8d9f1871be Connection: pass just the textCode values where necessary 11 years ago
Brian White 4dfe687a55 Connection: only pass specific text codes to callbacks 11 years ago
Brian White 3c507f20bb Connection: check UIDPLUS availability before attempting a UID EXPUNGE 11 years ago
Brian White 0e07b83230 Connection: fix style 11 years ago
Brian White 302e241458 Connection: fix nested OR when searching 11 years ago
Brian White 11b37fcd8f Merge pull request #283 from wavify/tagged-ok
Pass tagged OK text code as the last argument of the callback (for APPENDUID, COPYUID, etc.)
11 years ago
Brian White 9f5ba4de8c Merge pull request #307 from dominikgehl/dgl/idExtension
support for IMAP ID extension (RFC 2971)
11 years ago
Dominik Gehl 93337c567f further improvements to ID extension support 11 years ago
Dominik Gehl 4ff1b82b9f ID support improvements 11 years ago
Brian White 9ee0f51818 connection: add additional guards for idle changing 11 years ago
Dominik Gehl b697dfe66d support for IMAP ID extension (RFC 2971) 11 years ago
Ronnie 91fd2d1512 Removed separate if for esearch result 11 years ago
Ronnie 436a2761b2 esearch should call _esearch and return data to callback. Removed space in _esearch command and put it before encode, as query already has a space 11 years ago
Dominik Gehl bf9984f063 allow flags with backslash in append
https://github.com/mscdex/node-imap/issues/186
11 years ago
Brian White 377fbc1f98 lint 11 years ago
Chotiwat Chawannakul 0e89bca78e Handle undefined quota list response when set quota on some imap server (e.g. cyrus) 11 years ago
Brian White 69a9031d7c Connection: change style for hasNonASCII() 11 years ago
Brian White d028aadfca Merge pull request #291 from kevinoid/starttls-fixes
Fix broken STARTTLS
11 years ago
Kevin Locke b73f325327 Reattach 'readable' event listener when changing streams
Parser was not unregistering the 'readable' event listener from the old
socket, nor registering it to the new socket when setSocket() was
called.  This caused event handling to stop during the STARTTLS handoff.

Signed-off-by: Kevin Locke <klocke@quantpost.com>
11 years ago
Kevin Locke 2981485551 Fix for servers with LOGINDISABLED before STARTTLS
When connecting to a server that advertises LOGINDISABLED in its
CAPABILITIES before STARTTLS, the connection raises an error and
destroys the socket before completing STARTTLS.  This is demonstrated in
the following debug output:

debug: [connection] Connected to host
debug: <= '* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.'
debug: => 'A0 CAPABILITY'
debug: <= '* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED'
debug: <= 'A0 OK Pre-login capabilities listed, post-login capabilities have more.'
error: Error: Logging in is disabled on this server source=authentication
debug: [connection] Closed

It appears that a return after _starttls was overlooked (since _starttls
will call _login again once the STARTTLS has completed).

Signed-off-by: Kevin Locke <klocke@quantpost.com>
11 years ago
Sagar Mehta 57a80b854c switched error text to prefer whatever is in info.text field even in case of oauth error 11 years ago
Brian White a3a1d158c5 Parser: attempt workaround for broken mime encoded words
Some MUAs appear to break multi-byte characters across encoded word boundaries, which goes against RFC2047.

This change attempts to work around this by trying to concatenate broken encoded words that are separated by linear white space.
11 years ago
Raoul Wissink 1ecec69b00 Removed check for current request on EXPUNGE so event is always emitted. 11 years ago
Brian White 510aa0b7b9 Parser: remove Readable proxied event for node 0.8
readable-stream proxies some events in wrap(). Since the Parser doesn't care about any events other than 'readable', we remove the troublesome proxied 'error' event.

Fixes #285
11 years ago
Chotiwat Chawannakul 0f09bfdea6 Pass tagged OK text code as the last argument of the callback (for APPENDUID, COPYUID, etc.) 11 years ago
Chotiwat Chawannakul 06bd3b9037 Connection: fix getQuotaRoot crashes when box has no quota root 11 years ago
mscdex a5a3ccfb4d Connection: guard internal box manipulation 11 years ago
mscdex 86ac8ceabc Connection: remove old parameters for seq.fetch() 11 years ago
Alex Indigo 16dfe6a894 #276 Made parseHeader parse only header and ignore message's body + test. 11 years ago
mscdex 6b52620fd9 Connection: check both permFlags and flags in move() 11 years ago
mscdex 9625faab85 Connection: reword timeout error message 11 years ago
mscdex 4729de2dab Parser: fix header parsing so that folded whitespace between adjacent MIME encoded-words is ignored 11 years ago
mscdex 0662d18f50 Connection: guard possible direct socket write 11 years ago
mscdex ccf397d7f9 Connection: fix destroy() 11 years ago
mscdex 4285211a73 Connection: add guard for conditional 11 years ago
mscdex dff2ff4a90 Connection: make end() more graceful, add destroy() for more forceful 11 years ago
Celal Baris Ozdemir 976e21709c change state to disconnected when connection ends/closed 11 years ago
mscdex b1fc9f5f89 Connection: fix modifiers assignment for fetch() 11 years ago
mscdex 8c68fcc23d Parser: relax continuation response checking for broken IMAP server implementations 11 years ago
mscdex 7dd577a133 restore npm dependency on iconv-lite 11 years ago
mscdex 41554f5188 Connection: default to lowercased version of original attribute name if no mapping exists 11 years ago
mscdex 671c5b3e0d deps: add iconv-lite fork (for now) 11 years ago
mscdex 2d7012a835 Parser: use (slower?) pure-JS fallback for encodings that iconv-lite does not support 11 years ago
mscdex 30d0b12953 lint 11 years ago
Roger Garner e787146ef4 Add support for SUBSCRIBE, UNSUBSCRIBE and LSUB
IMAP can subscribe to / unsubscribe from folders. Servers such as
Dovecot do not automatically subscribe to newly created mailboxes, you
must subscribe to them after creation.

subscribeBox - Subscribes to the specified box.
unsubcribeBox - Unsubscribes from the specified box.
getSubscribedBoxes - Issues a LSUB command to the server. Whilst LIST
returns all folders, LSUB only returns the folders the user has
subscribed to.
11 years ago
mscdex 201818dda1 Parser: fix typo 11 years ago
mscdex 88359f9f43 First go at CONDSTORE support 11 years ago
mscdex 00caa8f7b5 misc cleanup 11 years ago
mscdex f8f9310f56 Connection: add 'uidvalidity' event for unsolicited, untagged OK responses with uidvalidity text code 11 years ago
mscdex b06599ceb2 Connection: rename 'deleted' event name to 'expunge' 11 years ago
mscdex f942ede18a Connection: add 'update' event for unsolicited, untagged FETCH responses 11 years ago
mscdex f59e1239b1 Connection: do not filter box attribs 11 years ago
mscdex d7c2d89250 Connection: Don't modify permFlags 11 years ago
mscdex f831fd7fa0 Connection: refactor _store() and add setFlags() and setKeywords() 11 years ago
mscdex 8ea6b78532 Finish change over to always using preceding backslash for flags 11 years ago
mscdex 2b78b90dfa Connection: set 'ended' property sooner than the next tick 11 years ago
mscdex 5697fb601e Connection: add guard for conditional 11 years ago
Ross Johnson c1b1a0b2d1 Fix formatting 11 years ago
Ross Johnson 96af8f4a8e Fix fetch crash when all parts come back immediately
Resolves "TypeError: Cannot set property 'ended' of undefined" if
bodies are sent immediately and no msg is added to the fetchCache.
11 years ago
mscdex 1c5f756056 Connection: drop restrictive flag check for addFlags() 11 years ago
mscdex 41cb2e2502 Connection: add missing message 'ended' assignment 11 years ago
mscdex 9fd42bcbed Connection: always stringify and un-escape gmail labels in responses 11 years ago
mscdex 39b479de9d Connection: need to write CRLF after append() data 11 years ago
mscdex e96102d9ce Connection: 'level' is now 'source' for Errors 11 years ago
mscdex 0342642843 Connection: allow UTF-8 strings in search requests 11 years ago
mscdex a3125d0323 Connection: add 'type' to error object for tagged responses 11 years ago
mscdex dfae2cb8d0 Connection: defer message 'attributes' and 'end' events until next tick 11 years ago
mscdex d80b873a6e Connection: defer fetch 'end' event until next tick
Due to streams2' use of process.nextTick, without this patch body streams' 'end' events will emit after the fetch 'end' event, causing some confusion.
11 years ago
mscdex 517367ef19 Parser: check for unexpected readable-stream module behavior for node v0.8 11 years ago
mscdex 99e054b69c Parser: fix spacing 11 years ago
Roger Garner 2867d2ac96 Ending IDLE not being detected
As the buffer was wiped before emitting the 'other' event, the
parser.on('other') event handler has no buffer data passed to it thus
can't detect the end of the IDLE and never calls the
self._processQueue() to get the stuff waiting in the queue to move.
11 years ago
mscdex e2c7cdd32f Parser: add 'hack' to properly take care of non-literal BODY[*] 11 years ago
mscdex 1498020c2c Parser: decode encoded-words by default in parseHeader() 11 years ago
mscdex 92db64096f Parser: fix bug where entire chunk was being buffered instead of from current position onward 11 years ago
mscdex bf4c8ca7bf Parser: fix bug where _body isn't unset when body bytes left === chunk length 11 years ago
mscdex e99fa094dc Parser: remove redundant check 11 years ago
mscdex d4a9c30bbd Parser: don't set _read() for body until it's needed (push() returns false)
This fixes a problem where _read() was firing before the parsing function exited, causing the wrong data to be pulled in from the socket stream.
11 years ago