wildduck/imap-core/lib/commands/enable.js
2017-03-05 23:45:50 +02:00

26 lines
645 B
JavaScript

'use strict';
module.exports = {
state: ['Authenticated'],
schema: false,
handler(command, callback) {
let enabled = [];
command.attributes.map(attr => {
// only CONDSTORE is supported for now
if ((attr && attr.value || '').toString().toUpperCase() === 'CONDSTORE') {
this.condstoreEnabled = true;
enabled.push('CONDSTORE');
}
});
this.send('* ENABLED' + (enabled.length ? ' ' : '') + enabled.join(' '));
callback(null, {
response: 'OK',
message: 'Conditional Store enabled'
});
}
};