support find uid by multiple seqno

fork
Robin Qu 12 years ago
parent 0153a433d6
commit 2965e3f889

@ -368,8 +368,9 @@ exports.buildSearchQuery = function(options, extensions, isOrChild) {
try {
// last hope it's a seqno set
// http://tools.ietf.org/html/rfc3501#section-6.4.4
exports.validateUIDList([criteria]);
searchargs += modifier + criteria;
var seqnos = (args ? [criteria].concat(args) : [criteria]);
exports.validateUIDList([seqnos]);
searchargs += modifier + seqnos.join(',');
} catch(e) {
throw new Error('Unexpected search option: ' + criteria);
}
@ -378,6 +379,7 @@ exports.buildSearchQuery = function(options, extensions, isOrChild) {
if (isOrChild)
break;
}
console.log(searchargs);
return searchargs;
}

@ -0,0 +1,20 @@
var ImapConnection = require("../lib/imap").ImapConnection,
imap = new ImapConnection({
username: "pingkitnet@gmail.com",
password: "ping5555566666",
host: "imap.gmail.com",
port: 993,
secure: true
});
imap.connect(function() {
imap.openBox('INBOX', false, function() {
//find uid by seqno
imap.search([["1:5", "8:10"]], function(e, results) {
console.log(e, results);
imap.logout();
});
})
});
Loading…
Cancel
Save