mail: resolve list members
This commit is contained in:
@@ -12,6 +12,7 @@ exports = module.exports = {
|
||||
listMailboxes: listMailboxes,
|
||||
getLists: getLists,
|
||||
|
||||
get: get,
|
||||
getMailbox: getMailbox,
|
||||
getList: getList,
|
||||
getAlias: getAlias,
|
||||
@@ -169,6 +170,20 @@ function updateName(oldName, oldDomain, newName, newDomain, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function get(name, domain, callback) {
|
||||
assert.strictEqual(typeof name, 'string');
|
||||
assert.strictEqual(typeof domain, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
database.query('SELECT ' + MAILBOX_FIELDS + ' FROM mailboxes WHERE name = ? AND domain = ?',
|
||||
[ name, domain ], function (error, results) {
|
||||
if (error) return callback(new BoxError(BoxError.DATABASE_ERROR, error));
|
||||
if (results.length === 0) return callback(new BoxError(BoxError.NOT_FOUND, 'Mailbox not found'));
|
||||
|
||||
callback(null, postProcess(results[0]));
|
||||
});
|
||||
}
|
||||
|
||||
function getMailbox(name, domain, callback) {
|
||||
assert.strictEqual(typeof name, 'string');
|
||||
assert.strictEqual(typeof domain, 'string');
|
||||
|
||||
Reference in New Issue
Block a user