mail: remove config.fqdn use

This commit is contained in:
Girish Ramakrishnan
2018-01-24 11:33:09 -08:00
parent efc6a5acd0
commit 4e267c7cd1
3 changed files with 98 additions and 71 deletions

View File

@@ -4,6 +4,7 @@ exports = module.exports = {
add: add,
del: del,
get: get,
getAll: getAll,
update: update,
_clear: clear,
@@ -82,6 +83,18 @@ function get(domain, callback) {
});
}
function getAll(callback) {
assert.strictEqual(typeof callback, 'function');
database.query('SELECT ' + MAILDB_FIELDS + ' FROM mail ORDER BY domain', function (error, results) {
if (error) return callback(new DatabaseError(DatabaseError.INTERNAL_ERROR, error));
results.forEach(function (result) { postProcess(result); });
callback(null, results);
});
}
function update(domain, data, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof data, 'object');