nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
862 stars 146 forks source link

If server is closing, then HELO etc commands should not be accepted #181

Open titanism opened 2 years ago

titanism commented 2 years ago

Here we have https://github.com/nodemailer/smtp-server/blob/2bd0975292208f1cf77d7a93cb3d8b3c4d48acb8/lib/smtp-connection.js#L406 commands being parsed. However if the server is shutting down, commands such as HELO will still be accepted. Is there a way to add this feature, similar to how we can process onData, onRcptTo, etc? Then we could add if (this._closeTimeout) return setImmediate(() => callback(new Error('Server is shutting down'));.

titanism commented 2 years ago

Title updated