diff --git a/README.md b/README.md index 92c24f2..7bcfde6 100644 --- a/README.md +++ b/README.md @@ -554,7 +554,7 @@ Valid `options` are: * **markSeen** - < _boolean_ > - Mark message(s) as read when fetched. **Default:** false - * **struct** - < _boolean_ > - Fetch the message structure. **Default:** true + * **struct** - < _boolean_ > - Fetch the message structure. **Default:** false * **size** - < _boolean_ > - Fetch the RFC822 size. **Default:** false diff --git a/lib/imap.js b/lib/imap.js index 385a1e9..29b65e5 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -928,19 +928,14 @@ ImapConnection.prototype._fetch = function(which, uids, options, what, cb) { var toFetch = '', prefix, extensions, self = this, parse = true, headers, key, stream, - opts = { markSeen: false, struct: true, size: false }, fetchers = {}; if (typeof what === 'function') { cb = what; what = options; - } else { - if (options.markSeen) - opts.markSeen = true; - if (options.size) - opts.size = true; + options = {}; } - prefix = (opts.markSeen ? ' BODY.PEEK[' : ' BODY['); + prefix = (options.markSeen ? ' BODY.PEEK[' : ' BODY['); if (!Array.isArray(what)) what = [what]; for (var i = 0, wp, pprefix, len = what.length; i < len; ++i) {