From 3c507f20bbe4c0457c4bdf6f7b3f277403a7b0a6 Mon Sep 17 00:00:00 2001 From: Brian White Date: Tue, 15 Oct 2013 11:54:06 -0400 Subject: [PATCH] Connection: check UIDPLUS availability before attempting a UID EXPUNGE --- lib/Connection.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Connection.js b/lib/Connection.js index 05755ec..7136991 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -477,6 +477,9 @@ Connection.prototype.expunge = function(uids, cb) { validateUIDList(uids); uids = uids.join(','); + if (!this.serverSupports('UIDPLUS')) + throw new Error('Server does not support this feature (UIDPLUS)'); + this._enqueue('UID EXPUNGE ' + uids, cb); } else this._enqueue('EXPUNGE', cb);