const fs = require('fs');
const {SMTPServer} = require('smtp-server');
const smtp = new SMTPServer({
secure: true,
key: fs.readFileSync('certs/privkey.pem'),
cert: fs.readFileSync('certs/cert.pem'),
onData,
onRcptTo,
authOptional: true,
});
function onRcptTo(address, session, callback) {
console.log("IS HERE!!!");
callback();
}
function onData(stream, session, callback) {
stream.pipe(process.stdout);
}
smtp.listen(465);
Without secure option and post 25 accordingly all works, but not with it.
The certificate I got using Let's Encrypt through the Certbot. And also I tried to remain default certificate, but it doesn't work that way either. I tested it using mxtoolbox's tool and got the "Connection error" result
So, why is this happening?