From 4f9defb0a1b9a69f4eb7dde4bdf9334bee4d0c79 Mon Sep 17 00:00:00 2001 From: Robin Qu Date: Mon, 13 Aug 2012 13:16:53 +0800 Subject: [PATCH] support sequence set for search --- lib/imap.utilities.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/imap.utilities.js b/lib/imap.utilities.js index b8bf7e0..ff51f56 100644 --- a/lib/imap.utilities.js +++ b/lib/imap.utilities.js @@ -365,7 +365,14 @@ exports.buildSearchQuery = function(options, extensions, isOrChild) { searchargs += modifier + criteria + ' ' + args[0]; break; default: - throw new Error('Unexpected search option: ' + criteria); + try { + // last hope it's a seqno set + // http://tools.ietf.org/html/rfc3501#section-6.4.4 + exports.validateUIDList([criteria]); + searchargs += modifier + criteria; + } catch(e) { + throw new Error('Unexpected search option: ' + criteria); + } } } if (isOrChild)