nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 145 forks source link

Graceful shutdown support #178

Closed titanism closed 2 years ago

titanism commented 2 years ago

SMTP clients will reject the message with 550 error if the server is shut down while socket is still communicating.

Per https://github.com/nodemailer/smtp-server/blob/master/lib/smtp-server.js#L467-L486 in particular.

Instead of new Error('Socket closed unexpectedly') perhaps we do something different? E.g. 421 retry code on server shutdown?