From ee6793c93813e39b3985eae1692b27d85a9d34b8 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 20 Jul 2017 22:24:39 +0300 Subject: [PATCH] do not allow renaming INBOX --- lib/mailbox-handler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/mailbox-handler.js b/lib/mailbox-handler.js index 4fff3bd7..355c4921 100644 --- a/lib/mailbox-handler.js +++ b/lib/mailbox-handler.js @@ -95,6 +95,9 @@ class MailboxHandler { if (!mailboxData) { return callback(null, 'NONEXISTENT'); } + if (mailboxData.path === 'INBOX') { + return callback(null, 'CANNOT'); + } this.database.collection('mailboxes').findOne({ user: mailboxData.user, path: newname