Merge pull request #114 from wavify/message-size

Can request for message size when fetch
fork
Brian White 12 years ago
commit abc0c6bb21

@ -921,7 +921,10 @@ ImapConnection.prototype._fetch = function(which, uids, options) {
if (extensions)
cmd += extensions;
cmd += 'UID FLAGS INTERNALDATE';
cmd += (opts.request.struct ? ' BODYSTRUCTURE' : '');
if (opts.request.struct)
cmd += ' BODYSTRUCTURE';
if (opts.request.size)
cmd += ' RFC822.SIZE';
if (toFetch !== undefined) {
cmd += ' BODY';
if (!opts.markSeen)

@ -59,6 +59,8 @@ exports.parseFetch = function(str, literals, fetchData) {
fetchData.flags = result[i+1].filter(utils.isNotEmpty);
else if (result[i] === 'BODYSTRUCTURE')
fetchData.structure = exports.parseBodyStructure(result[i+1], literals);
else if (result[i] === 'RFC822.SIZE')
fetchData.size = parseInt(result[i+1], 10);
else if (typeof result[i] === 'string') // simple extensions
fetchData[result[i].toLowerCase()] = result[i+1];
}

Loading…
Cancel
Save