diff --git a/src/mail.js b/src/mail.js index 02c293f33..398937ee7 100644 --- a/src/mail.js +++ b/src/mail.js @@ -22,7 +22,7 @@ exports = module.exports = { sendTestMail: sendTestMail, - getMailboxes: getMailboxes, + listMailboxes: listMailboxes, removeMailboxes: removeMailboxes, getMailbox: getMailbox, addMailbox: addMailbox, @@ -888,7 +888,7 @@ function sendTestMail(domain, to, callback) { }); } -function getMailboxes(domain, callback) { +function listMailboxes(domain, callback) { assert.strictEqual(typeof domain, 'string'); assert.strictEqual(typeof callback, 'function'); diff --git a/src/maildb.js b/src/maildb.js index 088e28e94..b3c968594 100644 --- a/src/maildb.js +++ b/src/maildb.js @@ -4,7 +4,7 @@ exports = module.exports = { add: add, del: del, get: get, - getAll: getAll, + list: list, update: update, _clear: clear, @@ -81,7 +81,7 @@ function get(domain, callback) { }); } -function getAll(callback) { +function list(callback) { assert.strictEqual(typeof callback, 'function'); database.query('SELECT ' + MAILDB_FIELDS + ' FROM mail ORDER BY domain', function (error, results) { diff --git a/src/routes/mail.js b/src/routes/mail.js index e7972271a..91e6439d6 100644 --- a/src/routes/mail.js +++ b/src/routes/mail.js @@ -17,7 +17,7 @@ exports = module.exports = { sendTestMail: sendTestMail, - getMailboxes: getMailboxes, + listMailboxes: listMailboxes, getMailbox: getMailbox, addMailbox: addMailbox, updateMailbox: updateMailbox, @@ -214,10 +214,10 @@ function sendTestMail(req, res, next) { }); } -function getMailboxes(req, res, next) { +function listMailboxes(req, res, next) { assert.strictEqual(typeof req.params.domain, 'string'); - mail.getMailboxes(req.params.domain, function (error, result) { + mail.listMailboxes(req.params.domain, function (error, result) { if (error && error.reason === MailError.NOT_FOUND) return next(new HttpError(404, error.message)); if (error) return next(new HttpError(500, error)); diff --git a/src/server.js b/src/server.js index 0c1b3b615..9be46db47 100644 --- a/src/server.js +++ b/src/server.js @@ -260,7 +260,7 @@ function initializeExpressSync() { router.post('/api/v1/mail/:domain/enable', mailScope, routes.mail.setMailEnabled); router.post('/api/v1/mail/:domain/dns', mailScope, routes.mail.setDnsRecords); router.post('/api/v1/mail/:domain/send_test_mail', mailScope, routes.mail.sendTestMail); - router.get ('/api/v1/mail/:domain/mailboxes', mailScope, routes.mail.getMailboxes); + router.get ('/api/v1/mail/:domain/mailboxes', mailScope, routes.mail.listMailboxes); router.get ('/api/v1/mail/:domain/mailboxes/:name', mailScope, routes.mail.getMailbox); router.post('/api/v1/mail/:domain/mailboxes', mailScope, routes.mail.addMailbox); router.post('/api/v1/mail/:domain/mailboxes/:name', mailScope, routes.mail.updateMailbox);