mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-11-14 21:35:57 +08:00
27 lines
643 B
JavaScript
27 lines
643 B
JavaScript
'use strict';
|
|
|
|
const db = require('../db');
|
|
const consts = require('../consts');
|
|
|
|
// LSUB "" "*"
|
|
// Returns all subscribed folders, query is informational
|
|
// folders is either an Array or a Map
|
|
module.exports = server => (query, session, callback) => {
|
|
server.logger.debug(
|
|
{
|
|
tnx: 'lsub',
|
|
cid: session.id
|
|
},
|
|
'[%s] LSUB for "%s"',
|
|
session.id,
|
|
query
|
|
);
|
|
db.database
|
|
.collection('mailboxes')
|
|
.find({
|
|
user: session.user.id,
|
|
subscribed: true
|
|
})
|
|
.maxTimeMS(consts.DB_MAX_TIME_MAILBOXES)
|
|
.toArray(callback);
|
|
};
|