|
|
@ -523,6 +523,10 @@ ImapConnection.prototype.search = function(options, cb) {
|
|
|
|
ImapConnection.prototype.fetch = function(uids, options) {
|
|
|
|
ImapConnection.prototype.fetch = function(uids, options) {
|
|
|
|
if (this._state.status !== STATES.BOXSELECTED)
|
|
|
|
if (this._state.status !== STATES.BOXSELECTED)
|
|
|
|
throw new Error('No mailbox is currently selected');
|
|
|
|
throw new Error('No mailbox is currently selected');
|
|
|
|
|
|
|
|
if (typeof uids === undefined || typeof uids === null
|
|
|
|
|
|
|
|
|| (Array.isArray(uids) && uids.length === 0))
|
|
|
|
|
|
|
|
throw new Error('Nothing to fetch');
|
|
|
|
|
|
|
|
|
|
|
|
if (!Array.isArray(uids))
|
|
|
|
if (!Array.isArray(uids))
|
|
|
|
uids = [uids];
|
|
|
|
uids = [uids];
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -530,6 +534,7 @@ ImapConnection.prototype.fetch = function(uids, options) {
|
|
|
|
} catch(e) {
|
|
|
|
} catch(e) {
|
|
|
|
throw e;
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var defaults = {
|
|
|
|
var defaults = {
|
|
|
|
markSeen: false,
|
|
|
|
markSeen: false,
|
|
|
|
request: {
|
|
|
|
request: {
|
|
|
|