Connection: allow custom metadata to be fetched

fork
Matthias Biggeleben 9 years ago committed by Brian White
parent 5d2d9227e9
commit f74f257932

@ -576,6 +576,7 @@ Connection Instance Methods
* **envelope** - _boolean_ - Fetch the message envelope. **Default:** false
* **size** - _boolean_ - Fetch the RFC822 size. **Default:** false
* **modifiers** - _object_ - Fetch modifiers defined by IMAP extensions. **Default:** (none)
* **extensions** - _array_ - Fetch custom fields defined by IMAP extensions, e.g. ['X-MAILBOX', 'X-REAL-UID']. **Default:** (none)
* **bodies** - _mixed_ - A string or Array of strings containing the body part section to fetch. **Default:** (none) Example sections:
* 'HEADER' - The message header

@ -815,6 +815,11 @@ Connection.prototype._fetch = function(which, uids, options) {
fetching.push('BODYSTRUCTURE');
if (options.size)
fetching.push('RFC822.SIZE');
if (Array.isArray(options.extensions)) {
options.extensions.forEach(function (extension) {
fetching.push(extension.toUpperCase());
});
}
cmd += fetching.join(' ');
if (options.bodies !== undefined) {
var bodies = options.bodies,

Loading…
Cancel
Save