Files
simple-mail-cleaner/backend/node_modules/imapflow/lib/commands/starttls.js
2026-01-22 15:49:12 +01:00

20 lines
471 B
JavaScript

'use strict';
// Requests STARTTLS info from server
module.exports = async connection => {
if (!connection.capabilities.has('STARTTLS') || connection.secureConnection) {
// nothing to do here
return false;
}
let response;
try {
response = await connection.exec('STARTTLS');
response.next();
return true;
} catch (err) {
connection.log.warn({ err, cid: connection.id });
return false;
}
};