nodemailer / smtp-server

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

fix noop(empty string) command handler #138

Closed junminahn closed 4 years ago

junminahn commented 4 years ago

Hi, Folks, Our team had an issue using smtp-server/smpt-connection sending error back "500 Error: command not recognized" when the command is an empty string. And also found out that there is noop handler "handlerNOOP" but never used, I believe that it meant to be just "handler" to support "empty string" command.

andris9 commented 4 years ago

Why do you think empty string is a valid command that shoul not yield in error? NOOP is a standard command and must be supported.

junminahn commented 4 years ago

Hi andris9, We are trying to set up a SMTP server with "zone-mta" (https://github.com/zone-eu/zone-mta), which uses "smtp-server and smtp-connection". After starting the server, we tried to send an email with "nodemailer" as a client side and had an error "500 Error: command not recognized", which comes from "smtp-connection" line 450. The crashed command was an empty string and since we found the noop handler "handler_NOOP", we assumed that the handler is meant for an empty string command, and it solved the issue we had.

andris9 commented 4 years ago

SMTP server is handling this correctly. handler_NOOP() is called when client issues NOOP command. You should rather investigate how come Nodemailer is sending blank lines to the server which it is not supposed to do.

junminahn commented 4 years ago

@andris9 you are right that 'NOOP' Is a standard SMTP command, I found the place where sending a blank line to the server, so I will close this. thanks!