mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-08 17:07:44 +08:00
26 lines
607 B
JavaScript
26 lines
607 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const db = require('../db');
|
||
|
|
||
|
// LIST "" "*"
|
||
|
// Returns all folders, query is informational
|
||
|
// folders is either an Array or a Map
|
||
|
module.exports = server =>
|
||
|
(server.onList = function(query, session, callback) {
|
||
|
server.logger.debug(
|
||
|
{
|
||
|
tnx: 'list',
|
||
|
cid: session.id
|
||
|
},
|
||
|
'[%s] LIST for "%s"',
|
||
|
session.id,
|
||
|
query
|
||
|
);
|
||
|
db.database
|
||
|
.collection('mailboxes')
|
||
|
.find({
|
||
|
user: session.user.id
|
||
|
})
|
||
|
.toArray(callback);
|
||
|
});
|