Closed matteomattei closed 2 years ago
Maybe I have just found it:
return next({ responseCode: 535, message: 'Authentication failed - wrong credentials' });
If you set err.name = 'SMTPResponse'
then it does not throw
let error = new Error('Authentication failed - wrong credentials');
error.responseCode = 535;
err.name = 'SMTPResponse'
return next(error);
Great it works! Thank you
I would exclude "ERR!" in logs when something programatically went wrong and we want to close smtp connection. For example if I decide the authentication fails, the documentation says to return an instance of Error to the next callback like this:
Anyway this fills the logs with several lines like the following:
I would want only the last info line containing the AUTHFAIL, the user which tried to perform authentication and its IP address, not all other ERR! lines.
Any idea?