Closed krm35 closed 1 year ago
EDIT: the simpleParser triggers it that's why it's never triggered again.
Hello,
It seems that the stream doesn't trigger the end event , so the 250 OK isn't sent and services like protonmail try to resend the mail multiple times.
I call the callback after the parsing and it works but it shouldn't be done that way.
const {SMTPServer} = require("smtp-server"); const {simpleParser} = require("mailparser"); const server = new SMTPServer({ onData(stream, session, callback) { simpleParser(stream, {}, (err, parsed) => { if (err) return callback(err); console(parsed); /* triggered in the simpleParser stream.on('end', () => { callback(null, 'OK') }); */ callback(null, 'OK') }) }, disabledCommands: ['AUTH'] }); server.on("error", () => { }); server.listen(2525, "127.0.0.1");
EDIT: the simpleParser triggers it that's why it's never triggered again.
Hello,
It seems that the stream doesn't trigger the end event , so the 250 OK isn't sent and services like protonmail try to resend the mail multiple times.
I call the callback after the parsing and it works but it shouldn't be done that way.