mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-03-04 03:45:19 +08:00
Fixed LIST
This commit is contained in:
parent
fe5d3f123c
commit
8e42c4eb5b
2 changed files with 35 additions and 5 deletions
|
@ -133,12 +133,22 @@ module.exports = {
|
|||
|
||||
};
|
||||
|
||||
if (!mailbox) {
|
||||
if (!mailbox && !filterSpecialUseFlags) {
|
||||
// return delimiter only
|
||||
return listResponse(null, [{
|
||||
path: '/',
|
||||
flags: '\\Noselect'
|
||||
}]);
|
||||
let response = {
|
||||
tag: '*',
|
||||
command: 'LIST',
|
||||
attributes: [
|
||||
[{
|
||||
type: 'atom',
|
||||
value: '\\Noselect'
|
||||
}], '/', '/'
|
||||
]
|
||||
};
|
||||
this.send(imapHandler.compiler(response));
|
||||
return callback(null, {
|
||||
response: 'OK'
|
||||
});
|
||||
}
|
||||
|
||||
// Do folder listing
|
||||
|
|
|
@ -241,6 +241,26 @@ describe('IMAP Protocol integration tests', function () {
|
|||
});
|
||||
|
||||
describe('LIST', function () {
|
||||
it('should list delimiter', function (done) {
|
||||
let cmds = [
|
||||
'T1 LOGIN testuser pass',
|
||||
'T2 LIST "" ""',
|
||||
'T3 LOGOUT'
|
||||
];
|
||||
|
||||
testClient({
|
||||
commands: cmds,
|
||||
secure: true,
|
||||
port
|
||||
}, function (resp) {
|
||||
resp = resp.toString();
|
||||
expect(resp.match(/^\* LIST /mg).length).to.equal(1);
|
||||
expect(resp.indexOf('\r\n* LIST (\\Noselect) "/" "/"\r\n') >= 0).to.be.true;
|
||||
expect(/^T2 OK/m.test(resp)).to.be.true;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should list all mailboxes', function (done) {
|
||||
let cmds = [
|
||||
'T1 LOGIN testuser pass',
|
||||
|
|
Loading…
Reference in a new issue