Neah/node_modules/imapflow/lib/commands/capability.js
2025-04-17 12:39:10 +02:00

21 lines
545 B
JavaScript

'use strict';
// Refresh capabilities from server
module.exports = async connection => {
if (connection.capabilities.size && !connection.expectCapabilityUpdate) {
return connection.capabilities;
}
let response;
try {
// untagged capability response is processed by global handler
response = await connection.exec('CAPABILITY');
response.next();
return connection.capabilities;
} catch (err) {
connection.log.warn({ err, cid: connection.id });
return false;
}
};