Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Mailbox object is with the following structure
* **root** (boolean) `true` if the node is root
* **name** (string) unicode decoded name of the mailbox
* **path** (string) full path to the mailbox
* **delimiter** (string) path delimiting symbol
* **delimiter** (string) path delimiting symbol. In the event the server returns NIL for this (some servers do this for the INBOX), it will be coerced to a '/' at this time, but the behavior may be changed in the future depending on how the folder creation API is implemented.
* **listed** (boolean) mailbox was found in the LIST response
* **subscribed** (boolean) mailbox was found in the LSUB response
* **specialUse** (string) mailbox was identified as a special use mailbox ('\Trash', '\Sent', '\Junk' etc. see [RFC6154](http://tools.ietf.org/html/rfc6154#section-2))
Expand Down Expand Up @@ -247,7 +247,7 @@ Namespace object is with the following structure
Namespace element object has the following structure

* **prefix** is the prefix string
* **delimiter** is the hierarchy delimiter
* **delimiter** is the hierarchy delimiter. This can be null for some servers but will usually be a string.

**NB!** Namespace_Response_Extensions are not supported (extension data is silently skipped)

Expand Down
3 changes: 2 additions & 1 deletion src/browserbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,8 @@
return !arr ? false : [].concat(arr || []).map(function(ns) {
return !ns || !ns.length ? false : {
prefix: ns[0].value,
delimiter: ns[1].value
// The delimiter can legally be NIL which maps to null
delimiter: ns[1] && ns[1].value
};
});
};
Expand Down
18 changes: 18 additions & 0 deletions test/unit/browserbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,25 @@
delimiter: '/'
}]
});
});

it('should handle NIL namespace hierarchy delim', function() {
expect(br._parseNAMESPACE({
payload: {
NAMESPACE: [
// This specific value is returned by yahoo.co.jp's
// imapgate version 0.7.68_11_1.61475 IMAP server
imapHandler.parser('* NAMESPACE (("" NIL)) NIL NIL')
]
}
})).to.deep.equal({
personal: [{
prefix: '',
delimiter: null
}],
users: false,
shared: false
});
});
});

Expand Down