Can request for message size when fetch.

fork
Chotiwat Chawannakul 12 years ago
parent 4c9f28f910
commit 86b399238a

@ -862,7 +862,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